zoukankan      html  css  js  c++  java
  • NPM配置国内源

    NPM配置国内源

    如果你不会翻墙,或者经常NPM装不上东西,可以试一下国内的NPM镜像
    这是一个完整 npmjs.org 镜像,你可以用此代替官方版本(只读),同步频率目前为 10分钟 一次以保证尽量与官方服务同步。
    方法一,定制的 cnpm (gzip 压缩支持) 命令行工具代替默认的 npm
    $ npm install -g cnpm --registry=https://registry.npm.taobao.org
    方法二,直接通过添加 npm 参数 alias 一个新命令:
    alias cnpm="npm --registry=https://registry.npm.taobao.org
    --cache=$HOME/.npm/.cache/cnpm
    --disturl=https://npm.taobao.org/dist
    --userconfig=$HOME/.cnpmrc"

    Or alias it in .bashrc or .zshrc

    $ echo ' #alias for cnpm alias cnpm="npm --registry=https://registry.npm.taobao.org
    --cache=$HOME/.npm/.cache/cnpm
    --disturl=https://npm.taobao.org/dist
    --userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc
    使用第一种方法taobaoNPM使用的时候写成$ cnpm install [name],就可以安装了!!!
    使用第二种方法NPM按照原来的方法$ npm install [name]就可以了!!!
    如果想了解更多点击->cnpm

  • 相关阅读:
    C++中两种获取UUID的方法(编程)
    在python中发送自定义消息
    lib,dll的位置
    GetWindowText
    SuspendThread and ResumeThread
    创建线程检查按钮的状态
    C++检测句柄的权限
    POJ2186 强联通
    POJ2186 强联通
    POJ 1201 差分约束(集合最小元素个数)
  • 原文地址:https://www.cnblogs.com/ArielChen/p/7467515.html
Copyright © 2011-2022 走看看