Syntax Error: Error: Cannot find module ‘node
出現問題原因:
vscode運行前端項目輸入npm run dev命令觸發此錯誤
解決辦法:
指定淘寶鏡像安裝node-sass
win+r 打開cmd控制臺輸入
npm install -g cnpm --registry=https://registry.npm.taobao.org
安裝成功后運行
cnpm install node-sass 或 cnpm install node-sass@latest
安裝完成,查看cnpm
兩個都下載成功后就可以正常的運行項目了
附錄
npm關于node-sass提供的方法
以上就是Syntax Error: Error: Cannot find module 'node-sass'的介紹,做此記錄,如有幫助,歡迎點贊關注收藏!
本文來自博客園,作者:GoodTimeGGB,轉載請注明原文鏈接:https://www.cnblogs.com/goodtimeggb/p/17046205.html
作者:GoodTimeGGB
來源鏈接:https://www.cnblogs.com/goodtimeggb/p/17046205.html