Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-sass 下载失败 解决方案 #24

Closed
dongzm opened this issue May 4, 2017 · 38 comments

Comments

@dongzm
Copy link

commented May 4, 2017

下载项目的时候run install时,node-sass下载失败后来我在项目根目录下添加了一个.npmrc

sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=https://registry.npm.taobao.org

把node-sass的路径修改成淘宝的npm,就很顺利的可以在国内的网络环境下载了

@PanJiaChen

This comment has been minimized.

Copy link
Owner

commented May 4, 2017

这和该项目无关。。。node-sass普遍就是下载有问题
文档里也写了解决的方法

//建议不要用cnpm 安装有各种诡异的bug 可以通过如下操作解决npm速度慢的问题
npm install --registry=https://registry.npm.taobao.org

感谢提供了解决方案

@PanJiaChen PanJiaChen closed this May 4, 2017

@PanJiaChen PanJiaChen changed the title node-sass 下载失败 node-sass 下载失败 解决方案 May 4, 2017

@longzhaobi

This comment has been minimized.

Copy link

commented May 4, 2017

我项目一般都用yarn。全局用npm

@fuerpeng

This comment has been minimized.

Copy link

commented May 18, 2017

试过上面方法还不行的同学 ,可以把package.json中的node-scss依赖改为:"node-sass": "^4.5.0",

@Selina9101118

This comment has been minimized.

Copy link

commented Jun 15, 2017

npm install --registry=https://registry.npm.taobao.org执行的时候,
出现错误
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
然后又去下载python安装后设置了环境变量,
然后又重新执行npm install --registry=https://registry.npm.taobao.org
启动项目,一直报没有sass-loader和node-sass模块,
然后我的解决方案是分别执行这两条命令:
1、npm install sass-loader --save-dev
2、npm install node-sass --save-dev
头痛了一下午的问题终于解决了,泪奔啊。
希望对你们有帮助。

@xinkule

This comment has been minimized.

Copy link

commented Jun 17, 2017

我补充一下楼上的,下载python一定要记得是2.X版本的,不然也会一直提示找不到

@fandaxia

This comment has been minimized.

Copy link

commented Apr 24, 2018

翻一下墙用npm安装就好了

@XzwAndy

This comment has been minimized.

Copy link

commented Jun 26, 2018

安装Python3,提示找不到 2 ,安装Python 2 后报 node-sass 错误,我的解决办法:
1、先卸载 npm uninstall node-sass,
2、重新安装 npm install --registry=https://registry.npm.taobao.org

@macheng1

This comment has been minimized.

Copy link

commented Nov 7, 2018

還是安裝不了

@Xrq1995

This comment has been minimized.

Copy link

commented Nov 30, 2018

第一,我可以 查看到 node-sass 的版本号 是4.10.0
C:\WINDOWS\system32>node-sass -v
node-sass 4.10.0 (Wrapper) [JavaScript]
libsass 3.5.4 (Sass Compiler) [C/C++]
第二,运行还是报错 如下:
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
生成启动时间为 2018/11/30 23:50:06。
MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "4.0"。

生成失败。

MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "4.0"。

0 个警告
1 个错误

已用时间 00:00:00.50
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\18756\Desktop\vue-element-admin-master-1130-test\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\18756\Desktop\vue-element-admin-master-1130-test\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\18756\Desktop\vue-element-admin-master-1130-test\node_modules\node-sass
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN script-ext-html-webpack-plugin@2.0.1 requires a peer of html-webpack-plugin@^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.10.0 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.10.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@valleylmh

This comment has been minimized.

Copy link

commented Dec 6, 2018

从最新的master分支克隆下来没法安装依赖包
npm install 报错信息如下
image
换yarn安装也报错
image

请教各位大佬们,你们遇到过这种问题吗?

@jasonchrion

This comment has been minimized.

Copy link

commented Dec 6, 2018

从最新的master分支克隆下来没法安装依赖包
npm install 报错信息如下
image
换yarn安装也报错
image

请教各位大佬们,你们遇到过这种问题吗?

我也是,重装了nvm,node,vue等还是不行

@joker-ssh

This comment has been minimized.

Copy link

commented Dec 7, 2018

image
我同上

@jasonchrion

This comment has been minimized.

Copy link

commented Dec 7, 2018

问题解决了,是git版本的问题,重新安装非release版本2.20即可

@Wpcc

This comment has been minimized.

Copy link

commented Dec 27, 2018

image
我同上

我也遇到这个问题,虽然我配置了全局的淘宝镜像,不过还是按照作者的配置项重新安装了下,然后就莫名其妙的好了。npm install --registry=https://registry.npm.taobao.org

命令行显示如下语句后,开始正确地下载包了:

$ npm install --registry=https://registry.npm.taobao.org
npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and n                                       ew features!
npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@n                                       pmjs.com for more info.
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, fl                                       atted is its successor.

> husky@0.14.3 install C:\Users\Administrator\Desktop\后台管理\vue-element-admin                                       \node_modules\husky
> node ./bin/install.js

husky
setting up Git hooks
done
@as8982398

This comment has been minimized.

Copy link

commented Jan 8, 2019

问题解决了,是git版本的问题,重新安装非release版本2.20即可

大佬,能给个链接吗?我试过装好多个版本的git,都不行啊。。

@as8982398

This comment has been minimized.

Copy link

commented Jan 8, 2019

image
我同上

问题解决了吗?怎么解决的呢?

@TonyCMCC

This comment has been minimized.

Copy link

commented Jan 14, 2019

安装失败的原因是node-sass下载的地址不对,
正确的地址是在这个目录下:https://github.com/sass/node-sass/releases
而非https://github.com/sass/node-sass/releases/download/v4.11.0/win32-x64-59_binding.node
但是如果不翻墙还是很难下载下来。

安装时指定镜像源
npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass

@surest-sky

This comment has been minimized.

Copy link

commented Jan 17, 2019

y

image
我同上

问题解决了吗?怎么解决的呢?

同上,依旧没有解决这个问题

@zone1240

This comment has been minimized.

Copy link

commented Jan 17, 2019

image
问题同求大神解答~~~

@zone1240

This comment has been minimized.

Copy link

commented Jan 18, 2019

image
问题同求大神解答~~~

好吧,应该是git版本的问题,原git最新版2.20.1,卸载后再安装2.20.0版本再重新install就可以了

@TonyCMCC

This comment has been minimized.

Copy link

commented Jan 19, 2019

y

image
我同上

问题解决了吗?怎么解决的呢?

同上,依旧没有解决这个问题

npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass
这样安装

@thisisrui

This comment has been minimized.

Copy link

commented Feb 15, 2019

下载项目的时候run install时,node-sass下载失败后来我在项目根目录下添加了一个.npmrc

sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=https://registry.npm.taobao.org

把node-sass的路径修改成淘宝的npm,就很顺利的可以在国内的网络环境下载了

参照上面方案,已经解决问题,我是通过 npm config edit 命令进行配置。

@PanJiaChen PanJiaChen pinned this issue Feb 15, 2019

@mahaoming

This comment has been minimized.

Copy link

commented Feb 16, 2019

下载项目的时候run install时,node-sass下载失败后来我在项目根目录下添加了一个.npmrc

sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=https://registry.npm.taobao.org

把node-sass的路径修改成淘宝的npm,就很顺利的可以在国内的网络环境下载了

参照上面方案,已经解决问题,我是通过 npm config edit 命令进行配置。

配置了.npmrc之后还是不行,在npm config edit 要怎么配置的

@CharlesLiuO

This comment has been minimized.

Copy link

commented Feb 25, 2019

圈友们大家好,我也遇到了这个问题,我参考了大家上面提出的解决办法,发现这个是可以的:

首先,执行git update-git-for-windows 更新一下git版本。
然后,运行npm install --registry=https://registry.npm.taobao.org

我的就好了。

@q287806325

This comment has been minimized.

Copy link

commented Feb 25, 2019

如果提示error setting certificate verify locations,
就执行下面这个命令
git config --system http.sslverify false

@suopovate

This comment has been minimized.

Copy link

commented Mar 5, 2019

建议也可以试试 在安装项目依赖的时候
npm install --sass_binary_site=https://npm.taobao.org/mirrors/node-sass

@1129269131

This comment has been minimized.

Copy link

commented Apr 6, 2019

我网上找到一个解决办法
1、npm install --registry=https://registry.npm.taobao.org
2、npm install -g cnpm --registry=https://registry.npm.taobao.org (如果有cnpm的话可省略此步)
3、cnpm install node-sass

@ZeXuanAc

This comment has been minimized.

Copy link

commented Apr 25, 2019

有代理的可以使用 npm config set proxy http://server:port 设置代理。
我使用ssr 的代理就是 npm config set proxy http://127.0.0.1:1080 . 秒下,问题解决

@caizhuoqin

This comment has been minimized.

Copy link

commented Jun 21, 2019

vue-element-admin@4.2.1 dev D:\githublist\learngit\vue-element-admin
vue-cli-service serve

INFO Starting development server...
10% building 2/2 modules 0 activeevents.js:174
throw er; // Unhandled 'error' event
^

Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
[... lines matching original stack trace ...]
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vue-element-admin@4.2.1 dev: vue-cli-service serve
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vue-element-admin@4.2.1 dev 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\cai\AppData\Roaming\npm-cache_logs\2019-06-21T11_38_43_237Z-debug.log

一直都在报这个错误

@joneqq

This comment has been minimized.

Copy link

commented Jul 9, 2019

安装node-sass包:
set SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass/

npm install node-sass

@xdqsgit

This comment has been minimized.

Copy link

commented Jul 11, 2019

我的git安装后也一直报 没有找到git
使用 设置了 git username 后 重新打开cmd
定位到项目目录 运行 npm install 正常了
git配置说明
插个广告 476428413 element admin交流群

@XingZiqiang

This comment has been minimized.

Copy link

commented Jul 19, 2019

yorkie@2.0.0 install C:\Users\xingziqiang\Desktop\vue-element-admin\node_modules\yorkie
node bin/install.js

'node' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! yorkie@2.0.0 install: node bin/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the yorkie@2.0.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\xingziqiang\AppData\Roaming\npm-cache_logs\2019-07-19T06_11_49_042Z-debug.log

我的node 和 npm 在命令行都能查到版本,运行其他项目也没问题,但是install这个项目的时候就报node 错误,请教是什么原因啊

@Ban9Ylgxj799

This comment has been minimized.

Copy link

commented Jul 19, 2019

不要直接npm install
用下面这个
npm install --registry=https://registry.npm.taobao.org
亲测有效

@XingZiqiang

This comment has been minimized.

Copy link

commented Jul 19, 2019

不要直接npm install
用下面这个
npm install --registry=https://registry.npm.taobao.org
亲测有效

用的是你说的这个npm install --registry=https://registry.npm.taobao.org

@XingZiqiang

This comment has been minimized.

Copy link

commented Jul 19, 2019

$ npm install --registry=https://registry.npm.taobao.org
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.

yorkie@2.0.0 install C:\Users\xingziqiang\Desktop\vue-element-admin\node_modules\yorkie
node bin/install.js

'node' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! yorkie@2.0.0 install: node bin/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the yorkie@2.0.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\xingziqiang\AppData\Roaming\npm-cache_logs\2019-07-19T06_32_47_154Z-debug.log

@Ban9Ylgxj799

This comment has been minimized.

Copy link

commented Jul 19, 2019

$ npm install --registry=https://registry.npm.taobao.org
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.

yorkie@2.0.0 install C:\Users\xingziqiang\Desktop\vue-element-admin\node_modules\yorkie
node bin/install.js

'node' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! yorkie@2.0.0 install: node bin/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the yorkie@2.0.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\xingziqiang\AppData\Roaming\npm-cache_logs\2019-07-19T06_32_47_154Z-debug.log

不要直接npm install
用下面这个
npm install --registry=https://registry.npm.taobao.org
亲测有效

用的是你说的这个npm install --registry=https://registry.npm.taobao.org

npm install =》 npm run dev 报错之后 再回来使用上面那个

@carveybunt

This comment has been minimized.

Copy link

commented Aug 6, 2019

在homestead 7环境下,使用 npm install --registry=https://registry.npm.taobao.org,报错如下:

  • node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:

https://opencollective.com/core-js
https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

node-sass@4.12.0 postinstall D:\cheng\vue-admin\node_modules\node-sass
node scripts/build.js

Binary found at D:\cheng\vue-admin\node_modules\node-sass\vendor\win32-x64-64\binding.node
Testing binary
Binary is fine
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 1879 packages from 1919 contributors and audited 52719 packages in 310.336s
found 65 vulnerabilities (64 low, 1 high)
run npm audit fix to fix them, or npm audit for details
运行 npm audit fix,提示更新 npm,如下:

  • New minor version of npm available! 6.9.0 → 6.10.2 │
    │ Changelog: https://github.com/npm/cli/releases/tag/v6.10.2
    │ Run npm install -g npm to update!
    运行npm install -g npm,升级完成后。继续运行npm audit fix 或npm audit fix --force,依然报错:
  • fixed 0 of 64 vulnerabilities in 59944 scanned packages
    64 vulnerabilities required manual review and could not be updated

各位大佬,怎么手动解决呀?

@leqiang

This comment has been minimized.

Copy link

commented Aug 20, 2019

error in ./src/components/ScrollPane/index.vue

Module build failed:

Class constructor FileManager cannot be invoked without 'new'
in undefined (line undefined, column undefined)

@ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":
true,"id":"data-v-5dabeaca","scoped":true,"hasInlineConfig":false}!./node_modules/less-loader/dist/cjs.js?{"sourceMap":true}!./node_
modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/ScrollPane/index.vue 4:14-382 13:3-17:5 14:22-390
@ ./src/components/ScrollPane/index.vue
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/layout/components/TagsV
iew.vue
这个怎么解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.