項目場景:
很久沒運(yùn)行的項目突然依賴下載報錯,讓我很頭疼,之前都是運(yùn)行正常的,于是就是開找解決辦法。
問題描述
依賴下載遇到的報錯?。?!
scripts.install node-sass@^4.14.1 run “node scripts/install.js”:
[1/1] scripts.install node-sass@^4.14.1 run "node scripts/install.js", root: "D:\\oooo\\saas_crm-master\\node_modules\\_node-sass@4.14.1@node-sass"
Downloading binary from https://cdn.npmmirror.com/binaries/node-sass/v4.14.1/win32-x64-93_binding.node
Cannot download "https://cdn.npmmirror.com/binaries/node-sass/v4.14.1/win32-x64-93_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
原因分析:
大概意思就是這個地址已經(jīng)不能下載了,需要你下載到本地并且做一個代理:文章來源:http://www.zghlxwxcb.cn/news/detail-829972.html
解決方案:
-
第一步:
node -p "[process.platform, process.arch, process.versions.modules].join('-')"
查看當(dāng)前node版本對應(yīng)的node-sass的二進(jìn)制包 -
第二步:
到node-sass官方github庫下載對應(yīng)的release包。地址:https://github.com/sass/node-sass/releases。找到前面通過命令行查看對應(yīng)的release包名,然后下載下來
可以查看更多的版本,找到與第一步對應(yīng)的文件
并下載 -
第三步:
找到node的根目錄,并且創(chuàng)建node_sass文件夾,并且將第二步
下載的release包放到文件夾中 -
第四步:
配置環(huán)境變量,配置到系統(tǒng)變量里也行,但是最好配置在用戶變量里。新建-》變量名稱填SASS_BINARY_PATH-》變量的值為之前安裝包所在的路徑-》保存。
變量名:SASS_BINARY_PATH 變量值:你的node根目錄路徑\nodejs\node_sass\win32-x64-93_binding.node
5. 第五步:
重新安裝依賴即可,不會出現(xiàn)node-sass報錯的問題。文章來源地址http://www.zghlxwxcb.cn/news/detail-829972.html
到了這里,關(guān)于項目依賴安裝node-sass@^4.14.1 run “node scripts/install.js“報錯問題解決的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!