无法识别安装gulp-sass - 节点

时间:2015-10-12 09:56:52

标签: node.js windows npm gulp-sass node-sass

我正在使用nodejs和npm开发一个应用程序。我有Windows 10,我正在使用npm v.3.3.7和节点v.4.1.2。

要进行设置,我将完成以下步骤:

  1. 使用npm
  2. 安装NodeJs
  3. 从git下载Npm-master 3.3.7并覆盖文件夹C:\ Program Files \ nodejs \ node_modules \ npm
  4. 在Enviromental Variables C:\ Users \ bilias7 \ AppData \ Roaming \ npm; C:\ Program Files \ nodejs;中添加;对于当前用户和系统PATH变量。
  5. 直到这里一切正常我可以使用CMD中的node和npm,并且通过提升的CMD,我可以安装全局包。

    当我尝试安装gulp-sass时,问题就开始了,因为gulp-sass依赖于node-sass。命令bellow返回错误,该节点未被识别为内部或外部命令。

    npm install -g gulp-sass
    

    正如您在下面的错误中看到的那样,安装node-sass包时返回错误。

    'node' is not recognized as an internal or external command,
    operable program or batch file.
    npm WARN install:node-sass@3.3.3 node-sass@3.3.3 install: `node scripts/install.js`
    npm WARN install:node-sass@3.3.3 Exit status 1
    C:\Program Files\nodejs
    └── (empty)
    
    npm ERR! code 1
    

    所以我尝试使用bellow命令显式安装node-sass

    npm install -g node-sass
    

    然后我得到了详细的错误。我想在install.js执行中出现问题并且它没有与命令节点连接,但我无法弄清楚它是什么。

    C:\Program Files\nodejs\node-sass -> C:\Program Files\nodejs\node_modules\node-sass\bin\node-sass
    
    > node-sass@3.3.3 install C:\Program Files\nodejs\node_modules\node-sass
    > node scripts/install.js
    
    'node' is not recognized as an internal or external command,
    operable program or batch file.
    npm ERR! Windows_NT 10.0.10240
    npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "node-sass"
    npm ERR! node v4.1.2
    npm ERR! npm  v3.3.7
    npm ERR! code ELIFECYCLE
    
    npm ERR! node-sass@3.3.3 install: `node scripts/install.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the node-sass@3.3.3 install script 'node scripts/install.js'.
    npm ERR! This is most likely a problem with the node-sass package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     node scripts/install.js
    npm ERR! You can get their info via:
    npm ERR!     npm owner ls node-sass
    npm ERR! There is likely additional logging output above.
    
    npm ERR! Please include the following file with any support request:
    npm ERR!     C:\Windows\system32\npm-debug.log
    

    您还可以从here

    下载完整的日志文件

    任何想法都很有帮助,因为我已经花了20多个小时!!

1 个答案:

答案 0 :(得分:0)

可能在您的环境变量中未添加nodejs。检查 - Node.js doesn't recognize system path?

相关问题