0
我們試圖通過執行資源在廚師配方中使用'npm install'來解決節點依賴性問題。沒有通過廚師安裝的Npm依賴關係
這是我的廚師食譜:
execute "download dependancies from package.json" do
command "npm install --silent"
user "#{node['non_root_user']}"
end
這是我的包JSON:
"dependencies": {
"classnames": "^2.2.5",
"keymirror": "^0.1.1",
"moment": "^2.10.2",
"moment-timezone": "^0.4.0",
"node-sass": "^3.2.0",
"parse": "^1.4.2",
"react": "^0.13.2",
"react-swipeable": "^3.0.2"
},
"devDependencies": {
"babel-eslint": "^4.0.10",
"brfs": "^1.4.0",
"browser-sync": "^2.6.7",
"browserify": "^9.0.7",
"browserify-shim": "^3.8.5",
"classnames": "^2.2.5",
"dotenv": "^1.2.0",
"eslint": "^1.1.0",
"eslint-plugin-react": "^3.2.3",
npm install
只安裝dev-dependencies
但不dependencies
。有沒有使用npm install
來安裝所有依賴項的自動化方法?我是否錯過了npm的其他配置。
嘗試在'npm install'中使用'--only = production'選項。 – ishmaelMakitla
如果我使用'--only = production',它只會安裝'dependencies'而不是'dev-dependencies'是否正確? Ideailly應該安裝所有'dependencies'和'dev-dependencies'是不是'npm install'? – Bhushan
你怎麼知道'npm install'命令沒有安裝所有的依賴關係?我認爲'npm install'應該安裝devDepencies和依賴關係 –