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

[BUG] 🐛 "require('fs').writeFileSync()" causes npm publish failure with vague E403 error #6137

Closed
2 tasks done
rivy opened this issue Feb 6, 2023 · 2 comments
Closed
2 tasks done
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release

Comments

@rivy
Copy link

rivy commented Feb 6, 2023

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

OS name: WinOS
OS version: Microsoft Windows [Version 10.0.19044.2486]
node v18.6.0
npm v9.3.0

I ran into an ugly bug when trying to publish some packages over the weekend. With a horribly vague error message, it was quite a task to determine the actual problem. After much churn, here's the simple reproducible case I was able to generate:

  • package.json
{
  "name": "@rivy-labs/-x-8ff8f63d-6ef9-44ee-999b-fc9edf489c98-basic",
  "version": "2.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "require('fs').writeFileSync()"
  },
  "author": "Roy Ivy III <rivy.dev@gmail.com> (https://rivy.dev/)",
  "license": "MIT"
}

npm publish fails with this vaguely horrifying message:

npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmjs.org/@rivy-labs%2f-x-npm_***-basic
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.

Expected Behavior

npm publish succeeds.

Steps To Reproduce

Environment

  • OS Name: Windows
@rivy rivy added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Feb 6, 2023
@rivy rivy changed the title [BUG] 🐛 text "require('fs').writeFileSync()" [BUG] 🐛 text "require('fs').writeFileSync()" causes npm publish failure with vague E403 error Feb 6, 2023
@rivy rivy changed the title [BUG] 🐛 text "require('fs').writeFileSync()" causes npm publish failure with vague E403 error [BUG] 🐛 "require('fs').writeFileSync()" causes npm publish failure with vague E403 error Feb 6, 2023
rivy added a commit to rivy/js.os-paths that referenced this issue Feb 6, 2023
…6137)

# [why]

Using the text "require('fs').writeFileSync(...)" blocks `npm publish` from completing
successfully; it faults with a horribly vague `npm ERR! code E403 ...` error. Minor
modification of the text will bypass the fault.

Issue raised at [GH:npm/cli#6137](npm/cli#6137).
rivy added a commit to rivy/js.os-paths that referenced this issue Feb 6, 2023
…6137)

# [why]

Using the text "require('fs').writeFileSync(...)" blocks `npm publish` from completing
successfully; it faults with a horribly vague `npm ERR! code E403 ...` error. Minor
modification of the text will bypass the fault.

Issue raised at [GH:npm/cli#6137](npm/cli#6137).
rivy added a commit to rivy/js.xdg-portable that referenced this issue Feb 6, 2023
…6137)

## [why]

Using the text "require('fs').writeFileSync(...)" blocks `npm publish` from completing
successfully; it faults with a horribly vague `npm ERR! code E403 ...` error. Minor
modification of the text will bypass the fault.

Issue raised at [GH:npm/cli#6137](npm/cli#6137).
rivy added a commit to rivy/js.xdg-portable that referenced this issue Feb 6, 2023
…6137)

## [why]

Using the text "require('fs').writeFileSync(...)" blocks `npm publish` from completing
successfully; it faults with a horribly vague `npm ERR! code E403 ...` error. Minor
modification of the text will bypass the fault.

Issue raised at [GH:npm/cli#6137](npm/cli#6137).
rivy added a commit to rivy/js.xdg-app-paths that referenced this issue Feb 6, 2023
…6137)

## [why]

Using the text "require('fs').writeFileSync(...)" blocks `npm publish` from completing
successfully; it faults with a horribly vague `npm ERR! code E403 ...` error. Minor
modification of the text will bypass the fault.

Issue raised at [GH:npm/cli#6137](npm/cli#6137).
@fritzy
Copy link
Contributor

fritzy commented Mar 1, 2023

Sounds like it's failing validation by the registry itself.

Closing: this looks to be an issue with the registry which is outside the scope of this repo. For registry support please go to npmjs.com/support. If you believe this is a bug with the cli, please provide further clarifying details.

@fritzy fritzy closed this as completed Mar 1, 2023
@rivy
Copy link
Author

rivy commented Mar 1, 2023

@fritzy , I've found, simplified, presented, and, finally, worked around the problem.
I don't see a need to go through a "Contact Us" queue.
I'll just leave it to your organization from this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

2 participants