Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to publish some packages due to intermittent "npm publish" 403 error #361

Closed
chrispcampbell opened this issue Sep 28, 2023 · 0 comments · Fixed by #362, #363 or #364
Closed

Failed to publish some packages due to intermittent "npm publish" 403 error #361

chrispcampbell opened this issue Sep 28, 2023 · 0 comments · Fixed by #362, #363 or #364
Assignees
Labels

Comments

@chrispcampbell
Copy link
Contributor

After merging the previous PR #355 I attempted to publish new versions of all affected packages. The npm publish step worked for the first two (build and compile packages) but failed on the third (runtime):

npm notice 📦  @sdeverywhere/[email protected]
npm notice === Tarball Contents === 
npm notice 20.9kB ./dist/index.cjs  
npm notice 1.1kB  LICENSE           
npm notice 5.6kB  README.md         
npm notice 20.9kB dist/index.cjs    
npm notice 45.7kB dist/index.cjs.map
npm notice 16.1kB dist/index.d.cts  
npm notice 16.1kB dist/index.d.ts   
npm notice 19.3kB dist/index.js     
npm notice 45.4kB dist/index.js.map 
npm notice 1.2kB  package.json      
npm notice === Tarball Details === 
npm notice name:          @sdeverywhere/runtime                   
npm notice version:       0.2.1                                   
npm notice filename:      @sdeverywhere/runtime-0.2.1.tgz         
npm notice package size:  42.3 kB                                 
npm notice unpacked size: 192.4 kB                                
npm notice shasum:        b98ed509b8b99e44955f97408747ab2d9c57610d
npm notice integrity:     sha512-xp/aCCcXY9Txa[...]txsoAszISs9vg==
npm notice total files:   10                                      
npm notice 
npm notice Publishing to https://registry.npmjs.org/
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/@sdeverywhere%2fruntime - You cannot publish over the previously published versions: 0.2.1.
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.

This despite the fact that I didn't actually publish that version already. Others have run into similar issues:
npm/cli#5058
govuk-react/govuk-react#1146
https://twitter.com/jon_neal/status/1141717238577356800

The only way to deal with this is to do a version bump and publish for each of the affected packages.

It's possible this was caused in part by the fact that we were using pnpm run to do the publish step, which may potentially run some commands in parallel. I've since changed that to use --workspace-concurrency=1 to ensure that we publish in serial fashion, but not sure yet if that was the root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment