NPM 无法在 Windows 10 上安装 node-sass。

huangapple go评论66阅读模式
英文:

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 {&quot;os&quot;:&quot;darwin&quot;,&quot;arch&quot;:&quot;any&quot;} (current: {&quot;os&quot;:&quot;win32&quot;,&quot;arch&quot;:&quot;x64&quot;})
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 &quot;C:\\Program Files\\nodejs\\node.exe&quot; &quot;C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js&quot; &quot;install&quot; &quot;node-sass&quot;
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.

huangapple
  • 本文由 发表于 2020年1月3日 20:41:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/59578847.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定