node.js - NPM 无法在 Windows 10 上安装 node-sass
问题描述
在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等等,但没有任何效果。
PS 在我的旧电脑上运行完美。相同的节点,npm 版本。而且我还将所有AppData/npm AppData/npm-cache文件夹复制到新 PC - 但仍然无法正常工作。
也许有人面临同样的问题?也许缺少某些权限?
解决方案
根据这些错误消息,您应该安装为您的系统提供 bash shell 的软件(WSL、CygWin 等)
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
推荐阅读
- ansible - 使用 ansible 过滤器将项目列表转换为行
- mysql - 通过并拥有查询 mysql grupo
- javascript - 将二进制音频文件作为 POSTMAN 二进制请求发送
- python - 基于经度和纬度的两地之间的距离
- python-3.x - 无法在数据帧的特定索引上更新具有不同值的特定行?
- c# - 如何将每行具有不同组合框项的 DataTable 绑定到 DataGridView?
- python - 如何在从python中的动态输入中删除重复项的同时合并两个列表
- javascript - AWS + express -fileupload 的多种文件
- android - 如何将 DD/MM/YYYY "13/09/21" 转换为 "Tuesday, April 1"
- javascript - 引导确认在 onClick 事件中不起作用?