windows安装node-sass报错
来源:6-1 个人中心-用户信息获取+展示
jessica_0013
2018-06-30
安装Node-sass时报如下错误:
Error: Cannot find module 'tough-cookie'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (D:\ComputerStudy\Actual Project\mpvue\mpvue-demo\node_modules\_request@2.79.0@request\lib\cookies.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
× Install fail! Error: post install error, please remove node_modules before retry!
Run "C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js" error, exit code 1
Error: post install error, please remove node_modules before retry!
Run "C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js" error, exit code 1
at ChildProcess.proc.on.code (F:\Program Files\nodejs\node_global\node_modules\cnpm\node_modules\runscript\index.js:74:21)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
用命令卸载npm rm node-sass重新再安装还是一样的错误,在网上找了好久也没解决好,请问这个怎么解决呢?
2回答
-
我遇到一样的问题,原因可能是sass-loader版本太高
你装6的版本试试,我已经解决了:
cnpm i sass-loader@6.x --save-dev
cnpm i node-sass --save-dev112018-07-14 -
慕瓜8449030
2018-07-02
你用的是什么源?试试cnpm?
012018-07-05
相似问题
回答 1
回答 2