rodrigosantosbr

[Fedora] Node.js and npm installation

Feb 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

[Fedora] Node.js and npm installation

STEP 1: package installation

sudo dnf install nodejs npm nodejs-yarn

This will install V8 Javascript Engine, Node.js runtime and npm package manager and their dependencies.
Versions present in repositories are usually current or to-be (in Rawhide) Node.js LTS releases, including npm and V8 engine that come with them.

STEP 2: Make a directory for global installations:

2.1:

mkdir ~/.npm-global

2.2: Configure npm to use the new directory path:

npm config set prefix '~/.npm-global'

2.3: Change ~/.bashrc file and add this line:

export PATH=~/.npm-global/bin:$PATH

2.4: Back on the command line, update your system variables:

source ~/.bashrc

2.5: Test: Download a package globally without using sudo.

npm install -g jshint
Add Comment
Please, Sign In to add comment