簡體   English   中英

無法使用 npm 安裝 node-sass

[英]Cannot install node-sass using npm

我正在嘗試安裝 node-sass,但不斷收到相同的錯誤。 我在 stackoverflow 上提到了一些答案,但沒有一個對我有幫助。 我無法弄清楚問題究竟出在哪里。

包.json

{
  "name": "sass_pack",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

安裝 node-sass 的命令

npm install node-sass --save-dev

錯誤

C:\xampp\htdocs\practice\sass_test>npm install node-sass --save-dev
'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g' is not recognized as an internal or external command,
operable program or batch file.

> node-sass@4.13.0 install C:\xampp\htdocs\practice\sass_test\node_modules\node-sass
> node scripts/install.js

npm WARN sass_pack@1.0.0 No description
npm WARN sass_pack@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\xampp\php
npm ERR! file C:\Windows\system32\cmd.exe;C:\xampp\php
npm ERR! path C:\Windows\system32\cmd.exe;C:\xampp\php
npm ERR! errno -4058
npm ERR! node-sass@4.13.0 install: `node scripts/install.js`
npm ERR! spawn C:\Windows\system32\cmd.exe;C:\xampp\php ENOENT
npm ERR!
npm ERR! Failed at the node-sass@4.13.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Dell\AppData\Roaming\npm-cache\_logs\2020-01-04T12_02_48_301Z-debug.log

我真的不明白命令有什么問題,所以請大家幫幫我

看起來有些東西已經修改了您的 COMSPEC 以包含和額外的“C:\\xampp\\php”您可以按照故障排除指南中的步驟進行確認https://github.com/sass/node-sass/blob/master/疑難解答.md#windows

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM