如何使用Node-Sass安装脚本解决错误

我正在尝试启动一个新的Angular项目,但是我一直遇到node-sass@4.13.0无法安装的错误。

Screenshot after running npm install.

在阅读类似的问题之后,我尝试同时运行npm install node-sass@latest和更改节点版本,但均未解决问题。

有关更多信息,错误日志指出:

2213 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
2214 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
2215 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
2215 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
2215 verbose notsup SKIPPING OPTIONAL DEPENDENCY: actual OS:   win32
2215 verbose notsup SKIPPING OPTIONAL DEPENDENCY: actual Arch: x64
2216 warn optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 (node_modules\@angular-devkit\build-angular\node_modules\node-sass):
2217 warn optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.12.0 install: `node scripts/install.js`
2217 warn optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
2218 verbose optional SKIPPING OPTIONAL DEPENDENCY:
2218 verbose optional Failed at the node-sass@4.12.0 install script.
2218 verbose optional SKIPPING OPTIONAL DEPENDENCY: This is probably not a problem with npm. There is likely additional logging output above.
2219 verbose stack Error: node-sass@4.13.0 install: `node scripts/install.js`
2219 verbose stack Exit status 1
2219 verbose stack     at EventEmitter.<anonymous> (C:\programdata\nvm\v10.15.3\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
2219 verbose stack     at EventEmitter.emit (events.js:189:13)
2219 verbose stack     at ChildProcess.<anonymous> (C:\programdata\nvm\v10.15.3\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
2219 verbose stack     at ChildProcess.emit (events.js:189:13)
2219 verbose stack     at maybeclose (internal/child_process.js:970:16)
2219 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
2220 verbose pkgid node-sass@4.13.0
2221 verbose cwd C:\Users\xdani\Desktop\Angular\strive-with-me
2222 verbose Windows_NT 10.0.17763
2223 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-sass@latest"
2224 verbose node v10.15.3
2225 verbose npm  v6.4.1
2226 error code ELIFECYCLE
2227 error errno 1
2228 error node-sass@4.13.0 install: `node scripts/install.js`
2228 error Exit status 1
2229 error Failed at the node-sass@4.13.0 install script.
2229 error This is probably not a problem with npm. There is likely additional logging output above.
2230 verbose exit [ 1,true ]

有什么建议吗?

谢谢,非常感谢您的宝贵时间!

mss0800 回答:如何使用Node-Sass安装脚本解决错误

检查:-

1) node --version
2) ng --version
3) npm --version

如果节点不存在,请转到https://nodejs.org/en/download/并将其下载到关闭终端并运行“ npm install

尝试:-

1) npm cache clean --force
or,1) npm cache verify --force

2) Delete node_modules
3) kill terminal
4) npm install

如果它不起作用,

尝试npm install --unsafe-perm

本文链接:https://www.f2er.com/3120357.html

大家都在问