简体   繁体   English

npm install在node-sass安装中抛出错误

[英]npm install throwing error in node-sass installation

I am trying to do an npm install command, But getting below error while installing the node-sass . 我正在尝试执行npm install命令,但是在安装node-sass出现以下错误。

在此处输入图片说明

在此处输入图片说明

package.json : package.json:

{
  "name": "XXXXX",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "angular": "1.4.9",
    "angular-ui-router": "0.3.1",
    "bootstrap": "3.3.7",
    "angular-ui-bootstrap": "2.2.0",
    "gulp": "^3.9.1",
    "gulp-open": "2.0.0",
    "gulp-run": "^1.7.1"
  },
  "devDependencies": {
    "gulp-jsbeautifier": "^2.0.3",
    "gulp-sass": "^2.3.2",
    "gulp-watch": "^4.3.10"  
  },
  "author": "XXXXX",
  "license": "XXX"
}

My node version is v6.9.2 and npm version is 3.10.9 . 我的node versionv6.9.2npm version3.10.9

I tried below SO links to find some solution but did not work. 我尝试在SO链接下面找到一些解决方案,但是没有用。

Any help will be highly appreciable. 任何帮助将是非常可贵的。 Thanks 谢谢

You are possibly behind of proxy server. 您可能落后于代理服务器。 You should do proxy settings to access github for downloading node-sass. 您应该进行代理设置以访问github来下载node-sass。

I saw this problem before and the reason was for more than one node binaries, but in Windows I don't know if it should be possible. 我之前看到过这个问题,原因是有多个节点二进制文件,但是在Windows中,我不知道是否应该这样做。

Anyway, if this is the problem, there is a way to force npm to run package scripts with the same binary as npm uses when it executes, using: 无论如何,如果这是问题所在,有一种方法可以强制npm使用与npm执行时使用的二进制文件相同的二进制文件运行程序包脚本,方法是:

npm config set scripts-prepend-node-path true

If you don't want it, and you want that npm uses the same binary of node when you executes directly $ node.... you can do: 如果您不想要它,并且希望直接执行$ node时npm使用相同的node二进制文件...。您可以执行以下操作:

npm config set scripts-prepend-node-path false

If the problem is due to different binaries anyone works. 如果问题是由于不同的二进制文件导致的,则任何人都可以工作。

sudo npm install --unsafe-perm node-sass

如果您以某种方式在中国,则应安装VPN

sudo npm install node-sass --save-dev

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM