2016-02-10 25 views
0

我有一個package.json名爲「install」的npm運行腳本是否有特殊狀態?

"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的腳本對象中有特殊行爲的保留字嗎?

回答

1

從文檔:https://docs.npmjs.com/misc/scripts

安裝,安裝後:運行後安裝軟件包。

+0

謝謝,這很重要。 所以我不需要'npm install' +'npm run install',對不對? – Hugolpz

+0

'npm install'實際上會同時運行'npm install'和'npm run install',對嗎? – Hugolpz

+0

這是正確的。它將執行標準軟件包安裝,然後用戶定義「安裝」腳本。 – SteamDev

相關問題