npm i を実行した時の prepare , postinstall の実行順

package.json

{
  "name": "example-project",
  "version": "1.0.0",
  "scripts": {
    "preinstall": "echo preinstall",
    "install": "echo install",
    "postinstall": "echo postinstall",
    "prepare": "echo prepare"
  },
  "dependencies": {
    "react": "^18"
  }
}
npm i 

結果

preinstall

install

postinstall

prepare

● preinstall, install, postinstall, prepare を 実行しないオプション --ignore-scripts

--ignore-scripts をつけるとこれらのスクリプトは実行されません

npm i --ignore-scripts
No.2528
06/21 16:33

edit