Home > Web Front-end > JS Tutorial > How to operate node.js default npm installation directory

How to operate node.js default npm installation directory

php中世界最好的语言
Release: 2018-05-29 17:43:23
Original
1791 people have browsed it

This time I will show you how to operate node.jsDefault npmInstallation directory, what are the precautions when operating node.js default npm installation directory , the following is a practical case, let’s take a look.

Modification

1: Open CMD and view the configuration

npm config ls
Copy after login

Two: Create a folder on other physical 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 to the global directory, that is, D:\sw \develop\nodejs\npm The following node_

modules

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:

How to use the Node.js sandbox environment

How to use WebPack to configure vue multi-page

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

Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template