使用npm install安裝專案依賴的時候報錯

2022-06-29 06:48:08 字數 654 閱讀 8433

使用npm install安裝專案依賴的時候報錯:

npm err! code elifecycle

npm err! errno 1

npm err! [email protected] postinstall: `node scripts/build.js`

npm err! exit status 1

npm err!

npm err! failed at the [email protected] postinstall script.

npm err! this is probably not a problem with npm. there is likely additional logging output above.

意思是找不到sass,檢視node-sass檔案,裡面沒有檔案。

所以在npm install前設定sass源。

解決方案:直接在當前目錄下進行node-sass 的資料來源設定

npm config set sass_binary_site=

//然後重新安裝依賴

npm install

//執行程式

npm run dev

npm install 本地安裝與全域性安裝

npm的包安裝分為本地安裝 local 全域性安裝 global 兩種,從敲的命令列來看,差別只是有沒有 g而已 npm install grunt 本地安裝 npm install g grunt cli 全域性安裝 全域性目錄 通過 npm config set prefix 目錄路徑 來設定。...

npm install安裝依賴包失敗

npm 版本 6.9.0 node版本 11.13.0 安裝依賴的時候發現這個錯誤 error if you re sure you want to delete the entire cache,rerun this command with force.解決方案 強制清除快取 npm cache...

忽略npm install安裝失敗資訊

在package.json目錄下執行npm install命令時會提示某些模組安裝失敗,如下圖所示 上圖的提示資訊很明顯,無法建立網路連線。此時,我們可以先不用管這錯誤資訊,在工程根目錄下直接執行npm run dev或者npm start命令,看是不是能夠正常執行 若是能夠正常執行,那麼說明那些安...