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

--ignore-scripts flag is being ignored by npm ci #2434

Closed
satbirbains opened this issue Jan 2, 2021 · 4 comments · Fixed by #2455
Closed

--ignore-scripts flag is being ignored by npm ci #2434

satbirbains opened this issue Jan 2, 2021 · 4 comments · Fixed by #2455
Assignees
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@satbirbains
Copy link

satbirbains commented Jan 2, 2021

Current Behavior:

npm ci is not respecting the '--ignore-scripts' flag. The postintsall script is being executed regardless.

Expected Behavior:

I would expect 'npm ci --ignore-scripts' to behave in the same way as 'npm install --no-scripts' and not run any scripts. The two commands worked in the same way in 6.14.9 but no longer after updating to 7.3.0.

Steps To Reproduce:

  1. Create a package.json with postinstall:"echo running post install"
  2. Run npm install --ignore-scripts
  3. Run npm ci --ignore-scripts
  4. Post install script has been executed once but should not have executed at all.

Environment:

  • OS: Debian 10
  • Node: 15.5.0
  • npm: 7.3.0
@satbirbains satbirbains added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Jan 2, 2021
@satbirbains satbirbains changed the title [BUG] <title> --ignore-scripts flag is being ignored by npm ci Jan 2, 2021
@wraithgar
Copy link
Member

The cli/ci.js file is missing the same constraints that cli/install.js has, cf:

https://github.com/npm/cli/blob/latest/lib/ci.js#L41
and
https://github.com/npm/cli/blob/latest/lib/install.js#L42

@wraithgar wraithgar self-assigned this Jan 6, 2021
@wraithgar wraithgar removed the Needs Triage needs review for next steps label Jan 6, 2021
@wraithgar
Copy link
Member

Fixed in v7.4.0

@jedahan
Copy link

jedahan commented Oct 12, 2021

Has this been backported to v6 ?

@wraithgar
Copy link
Member

This shouldn't need to? It was working in v6 according to the OP

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

Successfully merging a pull request may close this issue.

3 participants