一、需要安裝 msbuild 微軟構建工具
npm install windows-build-tools --global --production
二、如需要安裝低版本的node,可以安裝nvm版本管理工具
如果你機器里的node版本太高,又不想卸載重新安裝低版本的node,可以安裝一個 NVM 版本管理工具,隨時切換node版本
1.下載安裝nvm:nvm for windows
2.安裝nvm后在命令窗口輸入命令 nvm,出現(xiàn)一堆提示文字后成功。
3.執(zhí)行安裝node版本命令 安裝指定版本(以14.18.3為例)
nvm install v14.18.3
一些nvm常用命令:
nvm list 查看已有版本
nvm use v14.18.3 切換到指定版本(以14.18.3為例)
nvm uninstall 14.18.3 卸載指定版本
先使用 nvm list 查看本機已成功安裝的node版本列表。如果未出現(xiàn)相關版本,可以查閱相關文檔:https://blog.csdn.net/qq_34373197/article/details/122809786
如果出現(xiàn) npm無法使用,提示:‘npm’ 不是內(nèi)部或外部命令,也不是可運行的程序
可以查閱相關文檔:https://blog.csdn.net/qq_34373197/article/details/122809786
三、如果需要安裝python的話
如果還提示出現(xiàn) python 的信息,說明還需要安裝python,去python官網(wǎng)下載對應版本的安裝包安裝即可,一般是2.7版本。python官網(wǎng)下載文章來源:http://www.zghlxwxcb.cn/news/detail-404541.html
四、重新安裝一遍 node-sass
先卸載,再安裝文章來源地址http://www.zghlxwxcb.cn/news/detail-404541.html
npm uninstall node-sass
npm install node-sass
到了這里,關于解決 npm ERR! node-sass 和 gyp ERR! node-gyp 報錯問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!