英文:
NPM can't install node-sass on windows 10
问题
在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等等,但仍然不起作用。
附言:在我的旧电脑上运行得很完美。相同的Node和NPM版本。我还将所有的AppData/npm AppData/npm-cache文件夹复制到新电脑上,但仍然不起作用。
也许有人曾遇到过相同的问题?也许缺少了一些权限?
英文:
Having problem with installing node-sass (all version 4.9.0, 4.12.0, 4.13.0 and so on) on windows 10.
NPM version - v6.4.1<br>
NODE version - v10.15.3
Problem:
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 ]
All steps are done:
--force, -g, --unsafe-perm and a lot of more, but nothing works.
P.S on my old computer it works perfect. Same node, npm version. And I also copy all AppData/npm AppData/npm-cache folders to new PC - but still not working.
Maybe someone was facing same problem? Maybe some permissions are missing?
答案1
得分: 2
根据这些错误消息,您应该安装提供系统 bash shell 的软件(如 WSL、CygWin 等)。
3101 错误 文件 bash
3102 错误 路径 bash
3103 错误 代码 ELIFECYCLE
3104 错误 错误号 ENOENT
3105 错误 系统调用 spawn bash
3106 错误 node-sass@4.13.0 安装: `node scripts/install.js`
3106 错误 spawn bash ENOENT
英文:
According to these error messages, you should install software that provides your system with a bash shell (WSL, CygWin, etc.)
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
答案2
得分: 0
根据 node-sass 文档,您需要安装 node-gyp 先决条件。
英文:
According to node-sass docs you need to install node-gyp prerequisites.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论