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
--ignore-scripts をつけるとこれらのスクリプトは実行されません
npm i --ignore-scripts