Home  >  Article  >  Web Front-end  >  How to change default global path using npm

How to change default global path using npm

php中世界最好的语言
php中世界最好的语言Original
2018-05-29 11:50:541680browse

This time I will show you how to use npm to change the default global path, and what are the precautions for using npm to change the default global path. The following is a practical case, let's take a look.

Command line mode

npm changes the default global path and cache path

npm config set prefix new path

npm config set cache new path

npm config set registry

https://registry.npm.taobao.org

View Change the result

npm config ls -l or npm config list

way to configure the file

Add file .npmrc in the user's home directory

Add file content

registry=https://registry.npm.taobao.org/
prefix=e:\nodejs\npm_global
cache=e:\nodejs\npm_cache
I believe you have mastered the method after reading the case in this article. For more exciting content, please pay attention to php Chinese Other related articles online!

Recommended reading:

How to use AngularJS to implement tab switching

How to use Koa2 to develop WeChat 2D Scan the QR code to pay

The above is the detailed content of How to change default global path using npm. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn