Home >Web Front-end >Front-end Q&A >How to install linux node cnpm

How to install linux node cnpm

藏色散人
藏色散人Original
2022-12-29 14:12:332421browse

Installation method of linux node cnpm: 1. Download the linux version of node and place it in the "/home/node/" directory; 2. Open linux and decompress gz; 3. Return to the root directory, Establish a soft connection; 4. Install cnpm through "npm install -g cnpm --registry=https://registry.npm.taobao.org".

How to install linux node cnpm

The operating environment of this tutorial: linux5.9.8 system, node v14.15.5 version, Dell G3 computer.

How to install linux node cnpm?

#linux Detailed graphic explanation of installing node, npm and cnpm

You must install node first before installing cnpm and npm! ! ! !

1. Download the linux version of node

Download | Node.js Chinese website

How to install linux node cnpm

How to install linux node cnpm

2. Put it in the /home/node/ directory. If linux does not have ftp installed, go to my other article. Local ftp connection to linux

3. Open Linux and decompress gz. Here, the xz suffix and the gz suffix are both compressed packages, but the decompression commands are different. The one I downloaded here is the gz suffix

cd /home/node/
tar -zxvf node-v14.15.5-linux-x64.tar.gz

How to install linux node cnpm

4. Return to the root directory. It is very important to note that ln -s cannot be a relative path.

cd /

5. To establish a soft connection, please note that ln -s is The lowercase L is not the uppercase I Attention! ! ! ! ! ! ! ! ! ! ! ! , I was fooled by this for almost an hour! ! !

ln -s /home/node/node-v14.15.5-linux-x64/bin/node /usr/local/bin/node
ln -s /home/node/node-v14.15.5-linux-x64/bin/npm /usr/local/bin/npm

How to install linux node cnpm

6. Check whether node and npm are successful.

node -v
npm -v

How to install linux node cnpm

7. Install cnpm

cd /
npm install -g cnpm --registry=https://registry.npm.taobao.org

How to install linux node cnpm

Open ftp and look at the /home/node/node-v14.15.5-linux-x64/bin/ directory. There is already cnpm underneath it

How to install linux node cnpm

8. Establish a soft connection

ln -s /home/node/node-v14.15.5-linux-x64/bin/cnpm /usr/local/bin/cnpm
cnpm -v

How to install linux node cnpm

9. The installation is complete.

Recommended learning: "node.js video tutorial"

The above is the detailed content of How to install linux node cnpm. 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