14

Following this question, NPM dependencies can be installed using:

$ npm install --ignore-scripts

Is there a way to mark that a dependency should be installed without running scripts in package.json?

This is because, when I run npm install --ignore-scripts, the dependency is added to package.json. As a result, other users will install the package while running scripts, however I want this certain package to never run scripts.

Kwoppy
  • 289
  • 3
  • 10
  • 1
    I have a similar issue and I am wondering if adding it to bundled/peer dependencies would work. – AncientSwordRage Mar 21 '19 at 08:48
  • I was wondering how to do this as well. Did you find an answer? Best. – Pedro Ivo Hudson Jul 17 '21 at 14:38
  • This article describes the command line tool `can-i-ignore-scripts`. It does provide an easy way to do the opposite of what you're asking for => When using `--ignore-scripts`, it gives a way to whitelist which dependencies SHOULD be allowed to run scripts. https://dev.to/naugtur/get-safe-and-remain-productive-with-can-i-ignore-scripts-2ddc – JWess Jan 10 '22 at 18:17

1 Answers1

-1

I could be wrong but I believe its: npm install -ignore-script package-name@version

Mark Rogers
  • 96,497
  • 18
  • 85
  • 138