【发布时间】:2020-01-03 12:41:54
【问题描述】:
在 Windows 10 上安装 node-sass(所有版本 4.9.0、4.12.0、4.13.0 等)时遇到问题。
NPM 版本 - v6.4.1
NODE 版本 - v10.15.3
问题:
3090 silly saveTree `-- node-sass@4.13.0
3091 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\fsevents):
3092 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
3093 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
3093 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
3093 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
3093 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
3094 verbose stack Error: node-sass@4.13.0 install: `node scripts/install.js`
3094 verbose stack spawn bash ENOENT
3094 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
3094 verbose stack at onErrorNT (internal/child_process.js:415:16)
3094 verbose stack at process._tickCallback (internal/process/next_tick.js:63:19)
3095 verbose pkgid node-sass@4.13.0
3096 verbose cwd C:\xampp\htdocs\web\wp-content\themes\web
3097 verbose Windows_NT 10.0.18362
3098 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-sass"
3099 verbose node v10.15.3
3100 verbose npm v6.4.1
3101 error file bash
3102 error path bash
3103 error code ELIFECYCLE
3104 error errno ENOENT
3105 error syscall spawn bash
3106 error node-sass@4.13.0 install: `node scripts/install.js`
3106 error spawn bash ENOENT
3107 error Failed at the node-sass@4.13.0 install script.
3107 error This is probably not a problem with npm. There is likely additional logging output above.
3108 verbose exit [ 1, true ]
所有步骤都已完成: --force、-g、--unsafe-perm 等等,但没有任何效果。
P.S 在我的旧电脑上运行完美。相同的节点,npm 版本。我还将所有 AppData/npm AppData/npm-cache 文件夹复制到新 PC - 但仍然无法正常工作。
也许有人面临同样的问题?也许缺少某些权限?
【问题讨论】:
-
在你的机器上安装wsl
-
或任何为您提供 bash shell 的软件(cygwin 等)
-
@EmanuelVintilă 谢谢,工作完美:) 你为我节省了很多时间。你可以提交你的答案