Coder Social home page Coder Social logo

npm-library's Introduction

npm-library

npm的网络代理和淘宝镜像的设置


一、网络代理设置

(一)添加代理

npm config set proxy http://serverId:port

(二)添加https代理

npm config set https-proxy http://serverId:port

(三)添加需要验证的代理

npm config set proxy http://username:possword@serverId:port

npm config set https-proxy http://username:possword@serverId:port

(四)如果代理不支持https的话需要修改npm存放package的网站地址。

npm config set registry "http://registry.npmjs.org/"

二、taobao镜像设置

(一)临时使用

npm --registry https://registry.npm.taobao.org install express

(二)永久使用,方法一

npm install -g cnpm --registry=https://registry.npm.taobao.org

(三)永久使用,方法二

(建议使用-[它是只修改npm的registry配置,并不像2中一样下载cnpm这个项目])

npm config set registry https://registry.npm.taobao.org

注意 检验是否安装成功:

(指的是永久型方法一)

cnpm config get registry 或 cnpm info express/other packageName

(指的是永久型方法二)

npm config get registry 或 npm info express/other packageName

(四)使用方法

(4.1指的是永久型方法一)

cnpm install packageName

(4.2指的是永久型方法二)

npm install packageName

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.