如何使用 node-sass 安装脚本解决错误 [英] How to solve error with node-sass install script
问题描述
我正在尝试启动一个新的 Angular 项目,但我一直遇到同样的错误,即 node-sass@4.13.0 无法安装.
I'm trying to start a new Angular project, but I keep running into the same error where node-sass@4.13.0 fails to install.
阅读类似问题后,我尝试运行 npm install node-sass@latest
和更改节点版本,但都没有解决问题.
After reading similar questions, I tried both running npm install node-sass@latest
and changing node versions, but neither solved the issue.
有关更多信息,错误日志说明了这一点:
For more information, the error log states this:
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 ]
有什么建议吗?
谢谢,非常感谢您的时间!
Thanks, really appreciate your time!
推荐答案
检查:-
1) node --version
2) ng --version
3) npm --version
如果节点不存在,请转到https://nodejs.org/en/download/ 并下载它关闭终端并运行npm install
"
If node is not there, go to https://nodejs.org/en/download/ and download it close terminal and run "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
这篇关于如何使用 node-sass 安装脚本解决错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!