Detailed explanation of the steps to modify the default npm installation directory of node.js

php中世界最好的语言
Release: 2018-05-21 14:41:08
Original
1683 people have browsed it

This time I will bring you modificationsnode.jsDefault npmInstallationDetailed directory steps,Notes on modifying node.js default npm installation directoryThere are Which ones, the following are practical cases, let’s take a look.

Default installation path: C:/Users/[username]/AppData/Roming/npm/node_meodules

Modify

One: Open CMD and view the configuration

npm config ls
Copy after login

Two: Create a folder on theotherphysical disk such as: D:\sw \develop\nodejs\npm

Three: Reset

npm config set prefix "D:\sw\develop\nodejs\npm" npm config set cache "D:\sw\develop\nodejs\npm\cache"
Copy after login

Four: Test

npm install express -g
Copy after login

-g means to install it in the global directory, that is, node_modules

## under D:\sw\develop\nodejs\npm #I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Detailed explanation of the steps to uninstall npm global modules and modify the default installation directory

Node.js sandbox environment Detailed explanation of usage steps

The above is the detailed content of Detailed explanation of the steps to modify the default npm installation directory of node.js. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!