Home > Article > Operation and Maintenance > How to solve the problem that centos npm command cannot be found
centos npm command cannot find the solution: 1. Use epel to install node; 2. Install npm and express; 3. Close xshell; 4. Restart.
The operating environment of this article: CentOS 7 system, node 0.10.25, DELL G3 computer
How to solve the problem that the centos npm command cannot be found Got a question?
Install npm under centos. Solve the problem of installing node under centos: command not found
Install
# wget http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz
yum install gcc openssl-devel gcc-c compat-gcc-34 compat-gcc-34-c
tar -xf node-v0.10.25.tar.gz# cd node-v0.10.25
# ./configure --prefix=/usr/local/node
make && make install
# ln -s /usr /local/node/bin/* /usr/sbin/
After the installation is completed, npm is also automatically installed.
Test
# node -v
#npm -v
Note: Sometimes after successful installation, xshell needs to be closed and restarted. nvm will take effect.
1. When installing node under linux, the prompt -bash: node: command not found.
2. In this case, you can use epel to install node:
sudo yum install epel-release
sudo yum install nodejs
node --version
##Outputting the version information proves that the installation is successful. 3. Install npm and express:
sudo yum install npm --enablerepo=epel
## sudo npm install - g expresssudo npm install -g express-generator
OK.
Recommended: "
centos usage tutorialThe above is the detailed content of How to solve the problem that centos npm command cannot be found. For more information, please follow other related articles on the PHP Chinese website!