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 nodejs and npm in linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is to share with you about how to install nodejs and npm in linux. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.

What is JS JS is the abbreviation of JavaScript, it is a literal scripting language, its interpreter is called JavaScript engine, is a part of the browser, mainly used for web development, can add a variety of dynamic effects to the website, make the web page more beautiful.

Download npm package

Download the npm installation package on the official website

2. Decompress and create a link

Unpack the package to / opt (where the general software is located). You can see that there are two executable files node and npm in the bin directory. Create a link to this file in / usr/local/bin

Sudo ln-s / opt/node-v0.12.10-linux-x86/bin/node / usr/local/bin/nodesudo ln-s / opt/node-v0.12.10-linux-x86/bin/npm / usr/local/bin/npm

Then use node-v _ NPM-v to verify whether it is successful

3. Switch to Taobao npm source

Modify the configuration file .bashrc, for example, modify the .bashrc file under a specific user only for that user, and modify the global configuration file if you want all users to take effect. Such as / etc/profile or / etc/bash.bashrc

Add the following code at the end of the configuration file:

Alias cnpm= "npm-registry= https://registry.npm.taobao.org\-cache=$HOME/.npm/.cache/cnpm\-disturl= https://npm.taobao.org/dist\-userconfig=$HOME/.cnpmrc"

Use source / etc/profile (the specific file modified after source) to make the configuration effective.

The above is how to install nodejs and npm in linux. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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: 0

*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

Servers

Wechat

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

12
Report