I think this may only affect npm v7, but I've found that when publishing, I have started to get an error at the publish step:
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/dist - You do not have permission to publish "dist". Are you logged in as the correct user?
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.
As you can see, it's not trying to publish the dist
subdirectory but a package called "dist" which I do not own. The workaround (or solution?) is to use a relative path, details below.
np
config:{
"np": {
"yarn": false,
"contents": "dist"
}
}
dist
directory so that consumers can import from the root of the module. This probably doesn't affect anything but thought I should disclose all tweaks.{
"scripts": {
"postversion": "cpy README.md dist/ && cpy package.json dist/"
}
}
np
publishes without error.
Maybe this is the solution and we don't need a fix π€·ββοΈ Use a relative path:
{
"np": {
"yarn": false,
"contents": "./dist"
}
}
np - 7.4.0
Node.js - 15.9.0
npm - 7.5.4
Git - 2.24.3
OS - macOS 11.2.1
Thank you for this project! It takes a lot of hassle out of npm publishing.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too