npm install --save node-sass --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist --sass-binary-site=http://npm.taobao.org/mirrors/node-sass

or

先改变本机的sass下载的数据源

npm config set sass-binary-site http://npm.taobao.org/mirrors/node-sass

 然后 安装

npm i node-sass -S

npm更换成淘宝的源

npm config set registry https://registry.npm.taobao.org
– 配置后可通过下面方式来验证是否成功
npm config get registry

发布npm包的时候切换为原始url:npm config set registry  https://registry.npmjs.org

也可安装nrm【管理npm的数据源的工具】:npm i -g nrm

显示数据源list: nrm ls

  npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
* taobao - http://registry.npm.taobao.org/
edunpm - http://registry.enpmjs.org/
eu ----- http://registry.npmjs.eu/
au ----- http://registry.npmjs.org.au/
sl ----- http://npm.strongloop.com/
nj ----- https://registry.nodejitsu.com/
pt ----- http://registry.npmjs.pt/

切换npm数据源:nrm use taobao或者nrm use eu

----------------------- 使用yarn ------------------------------------------

yarn config get registry
# -> https://registry.yarnpkg.com

可以改成 taobao 的源:

yarn config set registry https://registry.npm.taobao.org
# -> yarn config v0.24.5
# -> success Set "registry" to "https://registry.npm.taobao.org".
# -> Done in 0.03s.

npm i node-sass 报错&npm 镜像切换的更多相关文章

  1. npm install的时候报错 npm err code 1

    在学习vue的时候,npm install的时候报错  npm err code 1,当时很郁闷,是‘vue init webpack my-project’命令新建的模版项目 ,怎么会报错,第一次遇 ...

  2. npm包管理器报错-npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/@XXX(over 30000ms)

    由于这两天买的新电脑在短期内频频蓝屏.卡机,不得不把自己其他的本本拿出来换上,但是程序员换电脑是真的痛苦,其他不说就说一个配环境 真的折腾哈 我是一名前端菜鸟,现在自己的本本上使用的是npm包管理工具 ...

  3. 解决Homestead yarn , npm run dev, 命令报错问题!

    解决Homestead yarn , npm run dev, 命令报错问题! 2018年06月01日 11:50:51 偶尔发发颠 阅读数:1654    版权声明:本文为博主原创,未经博主同意,不 ...

  4. cnmp安装失败,报错npm ERR! enoent ENOENT: no such file or directory,

    1.cnmp安装失败 2.提示如下: bogon:node_modules liangjingming$ sudo npm install cnpm -g --registry=https://reg ...

  5. 解决 npm run dev b报错 “'webpack-dev-server' 不是内部或外部命令,也不是可运行的程序 或批处理文件。”

    摘自:https://www.cnblogs.com/laraLee/p/9174383.html 前提: 电脑已经安装了nodeJS和npm,  项目是直接下载的zip包. 在项目目录下运行“npm ...

  6. mac本地安装全局包报错npm WARN checkPermissions

    安装本地全局包时,本地报错 npm WARN checkPermissions Missing write access to /Users/xxx/.nvm/versions/node/v11.10 ...

  7. webpack配置自动打包重新运行npm run dev出现报错

    webpack配置自动打包重新运行npm run dev出现报错 运行npm run dev出现如下报错 Listening at http://localhost:8080(node:2328) U ...

  8. 【问题与解决】Mac OS通过 npm 安装 React Native 报错(checkPermissions Missing write access to /usr/local/lib/node_modules)

    报错情况: 当Mac OS通过 npm 安装 React Native 报错,警告文字为:checkPermissions Missing write access to /usr/local/lib ...

  9. Vue项目中执行npm run dev 不报错也不显示点击的地址链接

    问题描述: 输入npm run dev 没有报错也没有显示可以点击的地址链接,如下图: 解决方法: 具体配置: autoOpenBrowser默认为false,改为true.重新 npm run de ...

  10. npm install命令遇到relocation error: npm: symbol SSL_set_cert_cb的报错问题

    在安装elasticsearch-head的过程中npm install遇到如下报错 [root@localhost elasticsearch-head]# npm install npm: rel ...

随机推荐

  1. linux 环境变量的设置

    方法一: 在/etc/profile文件中添加变量[对所有用户生效(永久的)] 用VI在文件/etc/profile文件中增加变量,该变量将会对Linux下所有用户有效,并且是“永久的”. 要让刚才的 ...

  2. 21、Shuffle原理剖析与源码分析

    一.普通shuffle原理 1.图解 假设有一个节点上面运行了4个 ShuffleMapTask,然后这个节点上只有2个 cpu core.假如有另外一台节点,上面也运行了4个ResultTask,现 ...

  3. Oracle自动备份(多个库),压缩打包,删除原文件

    1.创建一个database_Backup.bat文件,用记事本打开 内容参考如下:(楼主这里自动备份了四个数据库) set "now=%date:~0,4%%date:~5,2%%date ...

  4. python find和index的区别

    如果找不到目标元素,index会报错,find会返回-1 >>> s="hello world" >>> s.find("llo&qu ...

  5. ROS里程计的学习

    采用增量式编码器来实现odometry的计算,首先采用编码器对脉冲进行采样实现左右轮运动状态的获取,然后再利用增量式测程法得到机器人车体当前坐标系的位姿. 增量式测量法是使用从编码器采样到的数据并依据 ...

  6. ICEM-点火器

    原视频下载地址:https://pan.baidu.com/s/1hrU75So 密码: k6nc

  7. HashMap(1.8)源码阅读

    先了解一下用到的位运算符:https://www.cnblogs.com/gavinYang/p/11196492.html 一.初始化 1.无参构造函数: //负载因子默认值 static fina ...

  8. Java8 拼接字符串 StringJoiner

    StringJoiner1.简单的字符串拼接 输出:HelloWorld 注:当我们使用StringJoiner(CharSequence delimiter)初始化一个StringJoiner的时候 ...

  9. cmd命令net和sc

    来看windows中启动和关闭服务的方法:在cmd下可有两种方法打开,分别是net和sc. 1.net用于打开没有被禁用的服务, NET命令是功能强大的以命令行方式执行的工具. 它包含了管理网络环境. ...

  10. 《Linux性能及调优指南》 Linux进程管理

    版权所有: 原文名称:<Linux Performance and Tuning Guidelines> 原文地址:http://www.redbooks.ibm.com/abstract ...