Dr.Knowitall
Dr.Knowitall

Reputation: 10498

Run npm install without node-gyp rebuild

I do a node-gyp rebuild in my post install scripts. Running node-gyp rebuild during will error out. How can I run npm install without node-gyp rebuild?

Upvotes: 12

Views: 8857

Answers (3)

Daniel Stejskal
Daniel Stejskal

Reputation: 63

Well if you don't want to install using npm install --ignore-scripts a for some reason use npm install only, you can override install script in package.json by some noop. For example:

"scripts" : {
    "install" : "echo"
}

works like a charm (tested with yarn too)

Upvotes: 2

Paleo
Paleo

Reputation: 23752

You can do:

npm install --ignore-scripts

But it's not perfect because it prevents to execute all scripts from all dependencies.

Upvotes: 7

Dr.Knowitall
Dr.Knowitall

Reputation: 10498

package.json under scripts do this:

"scripts": {
    "install": "install -d $(pwd)"
}

Upvotes: -3

Related Questions