-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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] --ignore-scripts is ignored, npm install runs build. #4202
Comments
That doesn’t look like surge’s script, it looks like your own. |
@ljharb Yeah, it's my own script of a package of mine, but I didn't think it would run if I passed I'm running I don't have an One thing is that |
The flag ignores install scripts of what you’re installing. It then has to run your project’s scripts, so it can potentially recompile with new dependencies. I can’t speak to the specific scripts or why they’re run; I’m only speaking to the expectation. |
Yeah, that's the weird thing. According to https://docs.npmjs.com/cli/v8/using-npm/scripts#npm-install, it will run these scripts:
I ensured I have none of those in the top level of the repo where package.json is. Then when I run I just tried I should make a reproduction. |
Check out this output that confirms what I'm seeing. The first command includes
I would provide the debug log that it says it outputs, but that doesn't exist for some reason. |
Added a reproduction to the OP. |
It seems that this is due to some behavior in newer |
I discovered that running |
@ljharb Is |
Yes. |
And so |
I can't make a simple reproduction of what I experienced (trying with npm 10). My project has changed a lot by now too. I'll just close this. |
I have the same problem... npm executes scripts despite passing ignore scripts
|
The flag
|
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm i surge -D --ignore-scripts
runs scripts:Expected Behavior
It should not run scripts. In the above output, you see the
build
script of a package failed.Steps To Reproduce
Environment
Reproduction
This can be reproduced with this repo:
https://github.com/lume/lume
Just
npm run fresh
to bootstrap the repo (in a Unix OS)npm install any-package-you-want -D --ignore-scripts
and you'll see it runs npm scripts.If you delete the
prepare
script frompackage.json
, the problem does not go away.npm
is trying to run scripts from a dependency that's already installed, it seems.The text was updated successfully, but these errors were encountered: