Why is npm running prepare script after npm install, and how can I stop it?

Alex Zak picture Alex Zak · Jun 12, 2017 · Viewed 12.3k times · Source

Whenever I run npm install <package> it installs the package alright, but then it automatically runs the prepare script.

It's worth mentioning that I've already checked that there is no postinstall script in the package.json.

Thank you girls/guys so much in advance! :)

Answer

Yasha picture Yasha · Jun 29, 2017

From https://docs.npmjs.com/misc/scripts:

prepare: Run both BEFORE the package is packed and published, and on local npm install without any arguments (See below). This is run AFTER prepublish, but BEFORE prepublishOnly.

Since NPM v5, prepare script is executed when you run npm install