首页 > 解决方案 > 在 node-sass@4.9.3 安装后脚本失败

问题描述

在过去的 3 天里,我一直在试图弄清楚这一点,但我完全迷失了。

这个应用程序过去可以在 Ubuntu 上完美运行,但由于我切换到 MacOS,我无法让它运行。

这些是形成巨大错误日志的最后几位代码。

有趣的是,我可以从通用 MacOS 终端安装 node-sass@4.12.0,但运行相同的“npm install node-sass@latest”命令会返回此错误。

有任何想法吗?

815 warn hoist-non-react-statics@3.1.0 requires a peer of react@>=14.x but none is installed. You must install peer dependencies yourself.
816 warn react-addons-css-transition-group@15.6.2 requires a peer of react@^15.4.2 but none is installed. You must install peer dependencies yourself.
817 warn react-redux@5.1.1 requires a peer of redux@^2.0.0 || ^3.0.0 || ^4.0.0-0 but none is installed. You must install peer dependencies yourself.
818 warn react-router@4.3.1 requires a peer of react@>=15 but none is installed. You must install peer dependencies yourself.
819 warn react-router-dom@4.3.1 requires a peer of react@>=15 but none is installed. You must install peer dependencies yourself.
820 warn react-router-hash-link@1.2.1 requires a peer of react@>=15 but none is installed. You must install peer dependencies yourself.
821 warn react-sound@1.2.0 requires a peer of react@^15.3.0 || ^16.0.0-0 but none is installed. You must install peer dependencies yourself.
822 warn react-transition-group@1.2.1 requires a peer of react@^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
823 warn react-transition-group@1.2.1 requires a peer of react-dom@^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
824 warn url-loader@1.1.2 requires a peer of webpack@^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
825 warn w@1.0.0 No description
826 warn optional SKIPPING OPTIONAL DEPENDENCY: speaker@0.3.1 (node_modules/speaker):
827 warn optional SKIPPING OPTIONAL DEPENDENCY: speaker@0.3.1 install: `node-gyp rebuild`
827 warn optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
828 verbose optional SKIPPING OPTIONAL DEPENDENCY:
828 verbose optional Failed at the speaker@0.3.1 install script.
828 verbose optional SKIPPING OPTIONAL DEPENDENCY: This is probably not a problem with npm. There is likely additional logging output above.
829 verbose stack Error: node-sass@4.9.3 postinstall: `node scripts/build.js`
829 verbose stack Exit status 1
829 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
829 verbose stack     at EventEmitter.emit (events.js:209:13)
829 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
829 verbose stack     at ChildProcess.emit (events.js:209:13)
829 verbose stack     at maybeClose (internal/child_process.js:1021:16)
829 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
830 verbose pkgid node-sass@4.9.3
831 verbose cwd /Users/wojciechwojas/Desktop/PROJEKTY/02_Kindergarten_Website
832 verbose Darwin 18.5.0
833 verbose argv "/usr/local/Cellar/node/12.10.0/bin/node" "/usr/local/bin/npm" "install"
834 verbose node v12.10.0
835 verbose npm  v6.11.3
836 error code ELIFECYCLE
837 error errno 1
838 error node-sass@4.9.3 postinstall: `node scripts/build.js`
838 error Exit status 1
839 error Failed at the node-sass@4.9.3 postinstall script.
839 error This is probably not a problem with npm. There is likely additional logging output above.
840 verbose exit [ 1, true ]


标签: sasscompiler-errorsnode-modules

解决方案


经过一段时间的谷歌搜索,我发现它可能与当前使用的节点版本有关。请参阅:https ://www.npmjs.com/package/node-sass

如果您无法升级模块版本,您可以使用 nvm-windows 之类的工具在节点版本之间切换(https://github.com/coreybutler/nvm-windows


推荐阅读