Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install npm for Linux

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to install npm in Linux". In daily operation, I believe many people have doubts about how to install npm in Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "how to install npm in Linux". Next, please follow the editor to study!

1. Install Nodejs on the official website of http://nodejs.org.

But the download of foreign address is too slow. It is recommended to download it from Taobao.

Decompress wget https://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz:

Tar-zxvf node-v4.4.7-linux-x64.tar.gz sets the environment variable:

Export PATH=$PATH:/opt/node-v4.4.7-linux-x64/bin2, install NMP download nmp installation package. Generally, it is included in the nodejs package. After setting the environment variable, you can directly use the nmp command. If it is not installed, download it first:

Official website address: www.npmjs.com

The installation uses the following command:

Node cli.js install npm-gf3, install CNMP (unnecessary) as the NMP sources are all abroad, it is very slow to download related resources, so it is recommended to use the domestic Taobao NPM image (http://npm.taobao.org/).

Packages installed through the cnmp command will be downloaded from Taobao NMP very quickly.

After $npm install-g cnpm-- registry= https://registry.npm.taobao.org is installed, the command to install the module is as follows:

$cnpm install [name] synchronization module command is:

Cnpm sync connect at this point, the study on "how to install npm in Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 228

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report