gpt4 book ai didi

node.js - 如何解决node-sass安装脚本错误

转载 作者:太空宇宙 更新时间:2023-11-03 23:52:32 26 4
gpt4 key购买 nike

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

Screenshot after running npm install.

阅读类似的问题后,我尝试运行 npm install node-sass@latest 并更改 Node 版本,但都没有解决问题。

有关详细信息,错误日志指出:

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 ]

有什么建议吗?

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

最佳答案

检查:-

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

如果 Node 不存在,则转到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

关于node.js - 如何解决node-sass安装脚本错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58811050/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com