Skip to content

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

@dongzm

Description

@dongzm

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

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

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

Activity

PanJiaChen

PanJiaChen commented on May 4, 2017

@PanJiaChen
Owner

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

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

感谢提供了解决方案

changed the title [-]node-sass 下载失败[/-] [+]node-sass 下载失败 解决方案[/+] on May 4, 2017
longzhaobi

longzhaobi commented on May 4, 2017

@longzhaobi

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

fuerpeng

fuerpeng commented on May 18, 2017

@fuerpeng

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

Selina9101118

Selina9101118 commented on Jun 15, 2017

@Selina9101118

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

xinkule commented on Jun 17, 2017

@xinkule

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

fandaxia

fandaxia commented on Apr 24, 2018

@fandaxia

翻一下墙用npm安装就好了

XzwAndy

XzwAndy commented on Jun 26, 2018

@XzwAndy

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

macheng1

macheng1 commented on Nov 7, 2018

@macheng1

還是安裝不了

Xrq1995

Xrq1995 commented on Nov 30, 2018

@Xrq1995

第一,我可以 查看到 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

valleylmh commented on Dec 6, 2018

@valleylmh

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

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

jasonchrion

jasonchrion commented on Dec 6, 2018

@jasonchrion

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

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

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

joker-ssh

joker-ssh commented on Dec 7, 2018

@joker-ssh

image
我同上

jasonchrion

jasonchrion commented on Dec 7, 2018

@jasonchrion

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

133 remaining items

hong-zhanqiang

hong-zhanqiang commented on Nov 4, 2022

@hong-zhanqiang

npm ERR! Error while executing:
npm ERR! E:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.com/sohee-lee7/Squire.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\hong'zhan'qiang\AppData\Roaming\npm-cache_logs\2022-11-04T13_55_58_488Z-debug.log

出现这个问题怎么弄啊

ALEXMORCER87

ALEXMORCER87 commented on Feb 3, 2023

@ALEXMORCER87

npm install node-sass --save-dev
image
两条命令都执行了,还是会报错

ALEXMORCER87

ALEXMORCER87 commented on Feb 5, 2023

@ALEXMORCER87

image
安装了python环境,但是报这个错误

ALEXMORCER87

ALEXMORCER87 commented on Feb 5, 2023

@ALEXMORCER87

项目无法启动的问题解决方案:node19 版本过高,需要降低版本,我降到了17.9.1
相关链接
https://blog.csdn.net/weixin_44582077/article/details/110237056

再按照 之前的
npm install --registry=https://registry.npm.taobao.org
npm run dev ("dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", //pakege-json的scripts里加上前缀启动项目)

fjqken

fjqken commented on Feb 24, 2023

@fjqken

image
这个老哥的实测有用

RaverHui

RaverHui commented on Mar 1, 2023

@RaverHui

有大神知道这是怎么回事吗? npm ERR! code 128 npm ERR! An unknown git error occurred npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.git npm ERR! git@github.com: Permission denied (publickey). npm ERR! fatal: Could not read from remote repository. npm ERR! npm ERR! Please make sure you have the correct access rights npm ERR! and the repository exists.

大佬 有答案了吗

cczxsong

cczxsong commented on Apr 6, 2023

@cczxsong

有大神知道这是怎么回事吗? npm ERR! code 128 npm ERR! An unknown git error occurred npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.git npm ERR! git@github.com: Permission denied (publickey). npm ERR! fatal: Could not read from remote repository. npm ERR! npm ERR! Please make sure you have the correct access rights npm ERR! and the repository exists.

大佬 有答案了吗

重新设置一下ssh key就好了

yuanbaoerer

yuanbaoerer commented on May 15, 2023

@yuanbaoerer

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.git
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\31031\AppData\Local\npm-cache_logs\2023-05-15T10_54_04_122Z-debug-0.log
有大佬知道我这里是什么问题吗?

Solaire-zero

Solaire-zero commented on Jun 26, 2023

@Solaire-zero

npm ERR! code 128 npm ERR! An unknown git error occurred npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/adobe-webplatform/eve.git npm ERR! git@github.com: Permission denied (publickey). npm ERR! fatal: Could not read from remote repository. npm ERR! npm ERR! Please make sure you have the correct access rights npm ERR! and the repository exists.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\31031\AppData\Local\npm-cache_logs\2023-05-15T10_54_04_122Z-debug-0.log 有大佬知道我这里是什么问题吗?

我这里是windows
用管理员权限打开powershell并cd到目录
执行 npm cache clean --force 后再install就可以了

iHTCboy

iHTCboy commented on Jul 25, 2023

@iHTCboy

Mac M1 ,用 v14.17.5 一直不行,最后,升级到 node v14.21.3 (npm v6.14.18) 就解决了 0.0

sxz156178

sxz156178 commented on Sep 13, 2023

@sxz156178

找到一篇文章 按照文章的版本就可以成功:https://blog.csdn.net/lwj_07/article/details/127845777
如果有出现chromedriverxxxxx:下载这个文件
https://npm.taobao.org/mirrors/chromedriver/2.27/chromedriver_win32.zip
npm install chromedriver --chromedriver_filepath=你的下载路径\chromedriver_win32.zip
这样就可以解决chromedriver下载失败的问题了

caoyunyou

caoyunyou commented on Dec 18, 2023

@caoyunyou

这边调整npm 版本为 12.13.1 就行了
可以先用 nvm 调整 nodejs 版本为 12.13.1
然后删除 node_modules 和 package-lock.json 文件
然后重新下载 npm i

mrwangjing

mrwangjing commented on Mar 7, 2024

@mrwangjing

https://blog.csdn.net/zhu7478848/article/details/128642538 按照这个版本对照,查看package.json里的 "node-sass": "^4.9.0", 下载node10 版本安装,然后删除 node_modules 和 package-lock.json 文件,然后重新下载 npm i 问题解决

BuHuang0317

BuHuang0317 commented on Aug 20, 2024

@BuHuang0317

问题大都遇了个遍,稍微整理下自己遇到的2个问题
1.git未配置ssh密钥的问题
主要提示:
例1: code :128 ;
例2: 1s-remote --tags --heads git://github, com/adobe-webplatform/eve.git ;
例3: An unknown git error occurred npm ERR!;

解决:配置ssh密钥即可(详见转载:https://www.cnblogs.com/cenima/p/17863883.html

2.首先看下自己的版本是否过高,我是16,跟楼上一个老哥是一样的,但是需要补充 :--legacy-peer-deps
忽略一些依赖问题
1724126244318

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @YCF@lystrosaurus@ifczt@GeniusHG@Zhwt

        Issue actions

          node-sass 下载失败 解决方案 · Issue #24 · PanJiaChen/vue-element-admin