如何使用 node-sass 安装脚本解决错误
How to solve error with node-sass install script
我正在尝试启动一个新的 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 ]
有什么建议吗?
谢谢,非常感谢您的宝贵时间!
检查:-
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
运行
npm upgrade node-sass
允许我解决问题。
我 运行 在尝试在本地托管一个用 React 构建的单页网站时遇到了同样的问题,这需要旧版本的节点(我不得不切换到 14.0.0)。
然而,在这样做的同时,我也想出了这个相当可怕的输出
found 270 vulnerabilities (3 low, 125 moderate, 140 high, 2 critical)
我正在尝试启动一个新的 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 ]
有什么建议吗?
谢谢,非常感谢您的宝贵时间!
检查:-
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
运行
npm upgrade node-sass
允许我解决问题。
我 运行 在尝试在本地托管一个用 React 构建的单页网站时遇到了同样的问题,这需要旧版本的节点(我不得不切换到 14.0.0)。 然而,在这样做的同时,我也想出了这个相当可怕的输出
found 270 vulnerabilities (3 low, 125 moderate, 140 high, 2 critical)