-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] error publish without cache config in package.json / publishConfig #2842
Comments
note : might also be the cause of #2843 (also seems to miss a default config) |
Getting same bug. Introduced here: 4a5dd3a#diff-c8bd325917d181608f40adecdcec3c76acde134cc15a9e4a0d18636698e4fe55 |
Updated npm and got the same problem. On version 7.5.4 everything worked well. |
Same bug. A note for others, at least for me, the workaround line ("cache": "~/.npm") needed to be added inside publishConfig in package.json, not at the top level. (Actually, getting a bunch of other weird bugs on this latest version too -- will have to roll back. For example, even after the workaround, after I publish, when I 'npm install mything@latest' it doesn't actually pick up the newly published version. I rolled back to 7.5.6 and my usual workflow (npm publish; cd ../other; npm install mything@latest ) started working again. |
I believe this PR may fix the issue: #2865 If you define a publishConfig, it pushes the defaults out the window, that PR makes sure all publishConfigs (including the defualts) are represented in the final opts that are generated. |
oO it seems to be a duplicate of #2834 |
duplicate of #2834 |
Current Behavior:
running
npm publish
get an error :Expected Behavior:
it should be a success
Steps To Reproduce:
npm publish
on a working projectEnvironment:
wsl archlinux
node v15.11.0
npm v7.6.1
workaround
adding "cache":"~/.npm" in package.json solves the problem.
fix
I guess list[0] here is supposed to be the default config... but for any reason is not resolved... but I may be wrong here.
I also notice https://github.com/npm/cli/blob/latest/lib/utils/flat-options.js#L50 is the only flatten option that is supposed not to be defined : maybe the problem is there ?
Might be related to this change (the code was
cache: join(npm.config.get('cache'), '_cacache'),
before, maybe get use default value if any ?The text was updated successfully, but these errors were encountered: