npm
npm copied to clipboard
Provide a better error message in case of an E400 bad request without further explanation from npm
trafficstars
A few days ago a semantic-release user ran into the following error
npm notice === Tarball Details ===
npm notice name: octoherd-script-download-files
npm notice version: 1.0.0
npm notice filename: octoherd-script-download-files-1.0.0.tgz
npm notice package size: 6.2 kB
npm notice unpacked size: 15.6 kB
npm notice shasum: 2fc9ca2c311743edf472586ae9f9773084719218
npm notice integrity: sha512-ToUk8Z/9lxlwV[...]IzmnNAW76j2uA==
npm notice total files: 11
npm notice
npm notice Publishing to https://registry.npmjs.org/
npm ERR! code E400
npm ERR! 400 Bad Request - PUT https://registry.npmjs.org/octoherd-script-download-files - Bad Request
After some research, it turned out that the package name hit a block list and was flagged as suspicious, hence the 400 error without any further explanation.
If that happens, we could provide an explanation that this might be the reason why it failed, to recommend to rename the package, and to reach out to the npm support team team to ask if the package name was flagged as suspicious.
We should probably also make clear that "This is most likely not a problem with @semantic-release/npm"