.npmrc is not created
See original GitHub issueExpected
When registry-url
input is set with env.NODE_AUTH_TOKEN
an .npmrc file should be created in project root.
Actual
When registry-url
input is set with env.NODE_AUTH_TOKEN
an .npmrc file is not created.
Reproduction
.github/workflows/publish.yml
name: Publish
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
scope: '@foo-software'
- name: Publish Packages
run: |
cat .npmrc
package.json
{
"name": "root",
"private": true,
"keywords": [
...
],
"scripts": {
...
},
"husky": {
...
},
"lint-staged": {
...
},
"devDependencies": {
...
}
}
Note: My project is a Lerna based monorepo, so the above package.json has minimal fields. Perhaps, this functionality requires certain fields / values, but I’m not sure why and what those fields would be.
GitHub Action output and linked here.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:14
Top Results From Across the Web
cannot locate .npmrc file after installing nodejs and npm on ...
My question is I am not able to locate .npmrc file. Is n't it weird. I want to know is it created by...
Read more >generate .npmrc file is not working properly
the generate npmrc file for Artifacts is not actually creating the tokenized string appropriately. I am unable to connect successfully with ...
Read more >Ubuntu Manpage: npmrc - The npm config files
The npm config command can be used to update and edit the contents of the user ... Additionally, this file is not read...
Read more >The Ultimate Guide to Configuring NPM - Stack Abuse
npmrc Files. npm allows you to use a few different rc files, much like ~/.bashrc , to set your configurations. The four locations...
Read more >config | npm Docs
Run npm config ls -l to see a set of configuration parameters that are internal to npm, ... Setting this to false results...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone who’s come across this, my workaround is below, but it feels like a hack since this functionality supposedly exists in
actions/setup-node
.Please stop adding comments that are not helpful in resolving this issue. For now I’m just using my workaround. I’m thinking about closing this since it hasn’t gotten attention from actual contributors. I’m simply reporting a feature of this project that is broken.
My use case isn’t very relevant, but since people have been inquiring and for context: it is simple and standard - I have a repo that includes the code for packages to be published to NPM. I’m using
actions/setup_node
to setup the Node.js environment which includes NPM and authorizing NPM.The README for this project states that it can be used for
configuring authentication for GPR or npm
.In the usage section of the README it provides an example that you might use to setup and environment to publish packages for NPM. See
Publish to npmjs and GPR with npm
example.This is the example from the README.
And this setup isn’t actually working.