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:
lume+lume git:develop ❯ npm i surge -D --ignore-scripts ✹ ✭
npm ERR! code 2
npm ERR! path /home/trusktr/src/lume+lume/packages/element-behaviors
npm ERR! command failed
npm ERR! command sh -c npm run build
npm ERR! > element-behaviors@2.2.11 build
npm ERR! > lume build
.
.
.
Expected Behavior
It should not run scripts. In the above output, you see the build script of a package failed.
Steps To Reproduce
Environment
- npm: 8.3.0
- Node: 17.3.0
- OS: Pop_os! Linux
- platform: System 76 Oryx Pro (I'm lovin' it!)
- npm config:
❯ npm config ls
; "builtin" config from /home/trusktr/.npm-packages/lib/node_modules/npm/npmrc
globalignorefile = "/etc/npmignore"
; prefix = "/usr/local" ; overridden by user
; "user" config from /home/trusktr/.npmrc
//registry.npmjs.org/:_authToken = (protected)
prefix = "/home/trusktr/.npm-packages"
; "project" config from /home/trusktr/src/lume+lume/.npmrc
engine-strict = true
legacy-peer-deps = true
package-lock = false
; node bin location = /home/trusktr/.n-node-versions/bin/node
; cwd = /home/trusktr/src/lume+lume
; HOME = /home/trusktr
; Run `npm config ls -l` to show all defaults.
Reproduction
This can be reproduced with this repo:
https://github.com/lume/lume
Just
- clone it,
npm run fresh to bootstrap the repo (in a Unix OS)
- then try
npm install any-package-you-want -D --ignore-scripts and you'll see it runs npm scripts.
If you delete the prepare script from package.json, the problem does not go away. npm is trying to run scripts from a dependency that's already installed, it seems.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm i surge -D --ignore-scriptsruns scripts:Expected Behavior
It should not run scripts. In the above output, you see the
buildscript of a package failed.Steps To Reproduce
Environment
Reproduction
This can be reproduced with this repo:
https://github.com/lume/lume
Just
npm run freshto bootstrap the repo (in a Unix OS)npm install any-package-you-want -D --ignore-scriptsand you'll see it runs npm scripts.If you delete the
preparescript frompackage.json, the problem does not go away.npmis trying to run scripts from a dependency that's already installed, it seems.