Node安装及自定义config
下载Node.js , Windows下安装一键到底, 没有什么说的. 主要是默认无法流畅使用, 包括流畅下载, 全局缓存之类. 如下是进一步设置, 包括:
- 设置淘宝镜像.
- 增加Yarn(npm优化版?) 并更改位置.
- 调整全局缓存和全局包位置
npm config set registry " --设置淘宝源
npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ --设置node-sass淘宝源
npm config set phantomjs_cdnurl -- 设置phantomjs淘宝源
npm config set electron_mirror https://npm.taobao.org/mirrors/electron/ -- 设置electron淘宝源 --检查结果:
npm config list
npm config get registry
... --安装Yarn
npm install -g yarn
yarn config set registry "https://registry.npm.taobao.org" --设置淘宝源
yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/ --设置node-sass淘宝源
yarn config set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs/ -- 设置phantomjs淘宝源
yarn config set electron_mirror https://npm.taobao.org/mirrors/electron/ -- 设置electron淘宝源 yarn config list [--json]
-- 修改全局
-- 修改全局缓存目录为:
npm config set cache "D:\nodejs\node_cache\"
npm config set prefix "D:\nodejs\node_global\"
-- 修改PATH.
增加PATH如上node所在目录下 D:\nodejs\node_global\ (这个同步修改很有必要, 不然-g全局安装的脚手架如yarn, 命令无法使用)
NODE_PATH 设置到D:\nodejs\node_global\node_modules
其他
- 如果用命令行设置较慢, 可以直接修改node 配置文件. 配置文件"."开头的文件, 通过git bash 等linux命令行编辑.
- %home% 进入到用户目录. 然后vim .npmrc .(i 进入编辑模式, 保存完Esc退出编辑模式, 然后冒号wq 保存.)
参考网址: https://blog.csdn.net/ppwwp/article/details/80001173
Node安装及自定义config的更多相关文章
- 修改node来增加自定义工具命令
如何通过node创建自定义cmd命令 一.命令功能的实现 1.将自己的自定义工具的文件夹放到当前使用的 node 的安装目录下的 node_modules 文件夹下面: 2.回到node安装目录下复制 ...
- 超详细Node安装教程
今天周末休息,我制定了我的2020年度规划,其中包含编写50篇养成写博文的习惯.算下来平均每周一篇,感觉也不是很难,但我的写作能力不是很好,争取一次比一次好!希望自己能够坚持下去.2020为自己而活, ...
- windows环境下node安装教程(超详细)
安装node.js 1.下载node: 下载地址:http://nodejs.cn/download/ node.js的zip包安装时是直接解压缩后就可以了, node.js的msi包是傻瓜式一路ne ...
- node安装插件方法
node安装插件方法有几种,这里列出常用的两种方法: 方法1: 进入要安装插件的目录,直接用 npm 软件安装包安装,如(安装express): cd /project npm install -g ...
- 如何将R包安装到自定义路径
参考 设置环境变量R_LIBS将R包安装到自定义路径 实际上是可以解决问题的, #环境变量完成以后,启动(重启)R,运行 .libPaths() 加载R包时,发现路径仍然未变成自定义的. 那么参 ...
- Node入门教程(3)第二章: Node 安装
Node 安装 官网下载地址: https://nodejs.org/en/download/ 安装方式 windows 下安装 建议直接选择:Windows Installer (.msi)下载进行 ...
- nginx-1.12.0版本(编译安装)-自定义安装路径
nginx-1.12.0版本(编译安装)-自定义安装路径 安装路径:/application/nginx-1.12.0 1.前期准备 安装编译需要的gcc和gcc-c++ yum install -y ...
- bower安装使用、git安装、node安装、weui安装开发
bower安装使用以及git安装 bower需要:node 和 git 1.Git安装:(选择第二项:Use Git from the Windows Command Prompt)2.node安装: ...
- node安装与升级
node安装与升级 1.安装 sudo apt-get install nodejs sudo apt-get install npm 2.升级 如果node不是最新的,node有一个模块叫n,是专门 ...
随机推荐
- learning makefile 定义命令包
- okhttp请求文件异常解决方法
微信借口中获取素材的接口返回只是一个缓存的文件流 InputStream, 接口中请求永久图片素材返回的是 InputStream; 接口项目获取到 InputStream 可以直接通过文件流写到文件 ...
- java子类继承父类的方法(代码简略版)
父类:public class Subjects { public void b() { System.out.println("学科"); } public void a(){ ...
- centos安装ruby
下面开始安装Ruby 一.下载Ruby源码包 wget ftp://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.7.tar.gz 二.解压安装Ruby tar zx ...
- mongodb安装建议
1)软件包的选择 确保使用最新的稳定版本.目前我们线上使用的版本是2.4.6.MongoDB软件包下载页面http://www.mongodb.org/downloads. 确保线上环境总是使用64位 ...
- binary and out mode to open a file
When I use binary and out mode to open a exist file, and to modify the 4th and 8th byte data to 0x78 ...
- My First Linux Module
My First Linux Module Today, I successfully build my first linux hello module. First of all add a di ...
- asp.net mvc6+ef框架做的书籍管理项目
效果图: 目录结构: book控制器代码: using System; using System.Collections.Generic; using System.Linq; using Syste ...
- winform获取EXE图片
winform获取EXE图片 using (FileStream fs = new System.IO.FileStream(n, FileMode.OpenOrCreate, FileAccess. ...
- RabbitMQ python模块pika生产者消费者轮询模型。
完整代码如下: 生产者,producer import pika connection = pika.BlockingConnection( pika.ConnectionParameters('lo ...