名为“install”的npm运行脚本是否具有特殊状态?

时间:2016-02-10 21:13:39

标签: node.js npm npm-install npm-run

我有package.json两个

"dependencies": {
  "d3": "~3.5.5",
  "forever": "^0.14.1"
},
"scripts": {
   "install":   "make -f install.makefile"
   "data":  "make -f data.makefile core",
   "serve": "node ./node_modules/.bin/forever ./node_modules/.bin/http-server"

}

当我通过运行npm run检查我的脚本时,我得到:

enter image description here

我想知道“install”是否是保留关键字,因为它没有与其他脚本分组。

在packages.json的脚本对象中,install是否为具有特殊行为的保留字?

2 个答案:

答案 0 :(得分:1)

来自文档:https://docs.npmjs.com/misc/scripts

  

install,postinstall:安装软件包后运行。

答案 1 :(得分:1)

它不是保留的,而是npm's built-in commands中的一个。

而不是npm run install,而不是npm install