简体   繁体   中英

Trying to install NPM for Node.JS using YUM

I am trying to get Node.JS working using this tutorial. I have managed to get node.js installed throuhg PuTTy, using the command:

yum install -y nodejs

And that seemed to work fine (I might have had to use sudo, I can't remember now)

I am really new to command line interfaces so please bear with me.

I also ran (from another webpage):

yum -y groupinstall "Development Tools"

Which also seemed to work fine, but didn't seem to install npm anywhere :(

Now, I can run and execute .js files from the command line using node file.js , and that seems to work fine. But now I am stuck in the above tutorial where it says to install Express. It says to run the command:

npm install express

Except I don't seem to have the command npm . I read somewhere that it no longer comes with the latest version of Node.JS, so what can I do? On all of my google searches, I can't seem to find a yum command to install expressjs or npm . Can anyone help me?

npm is a package on his own and you need to install it sepatately from nodejs

sudo yum install nodejs npm

Where is a chance you'll need to use an EPEL repository (depends on your distro)

sudo yum install nodejs npm --enablerepo=epel

BTW, official documentation on "Installing Node.js via package manager" located on official site: https://nodejs.org/en/download/package-manager/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM