Download Npm for Mac Os X Updated
Download Npm for Mac Os X
In this tutorial we will larn to install NodeJS and NPM on Mac using Homebrew.
Step 1: Install Homebrew
Homebrew is "The missing package manager for macOS".
Open terminal and type the following command.
$ /usr/bin/ruby -e "$(curlicue -fsSL https://raw.githubusercontent.com/Homebrew/install/principal/install)"
This will install Homebrew on your Mac. To check the version type the post-obit command.
$ brew -5
Output
YUSUF-MacBook-Pro:~ yusufshakeel$ brew -5 Homebrew 1.1.11 Homebrew/homebrew-cadre (git revision be9c; final commit 2017-03-09)
Why use Homebrew to install NodeJS?
If you are installing NodeJS via the installer from https://nodejs.org/ and then yous have to use sudo
to brand sure that information technology installs correctly. After that you accept to make changes in your system $PATH
by adding the path of the node executable. And if yous desire to uninstall node so you have track all the files that were created and get rid of them. In brusque its a long process.
That'southward why Homebrew is used. It makes the job piece of cake. It volition install/uninstall Node hands.
Step 2: Install Node via Homebrew
In the terminal type the following control to install Node.
$ brew install node
If everything installed successfully then you can blazon in the following command in the terminal to check the Node and NPM version.
$ node -v v7.vii.ii
$ npm -v 4.ane.ii
Possible issues/errors that may occur
YUSUF-MacBook-Pro:~ yusufshakeel$ brew install node ==> Installing dependencies for node: icu4c ==> Installing node dependency: icu4c ==> Downloading https://homebrew.bintray.com/bottles/icu4c-58.2.sierra.bottle.tar.gz Already downloaded: /Users/yusufshakeel/Library/Caches/Homebrew/icu4c-58.2.sierra.canteen.tar.gz ==> Pouring icu4c-58.2.sierra.bottle.tar.gz ==> Caveats This formula is keg-only, which means it was non symlinked into /usr/local. macOS provides libicucore.dylib (but aught else). If you lot demand to have this software first in your PATH run: echo 'consign PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile repeat 'consign PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile For compilers to notice this software you may demand to prepare: LDFLAGS: -L/usr/local/opt/icu4c/lib CPPFLAGS: -I/usr/local/opt/icu4c/include ==> Summary /usr/local/Cellar/icu4c/58.2: 242 files, 65MB ==> Installing node ==> Downloading https://homebrew.bintray.com/bottles/node-7.vii.2.sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring node-seven.vii.two.sierra.bottle.tar.gz Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink share/doctor/node/gdbinit /usr/local/share/md/node is not writable. Y'all can effort once again using: brew link node ==> Using the sandbox ==> Caveats Bash completion has been installed to: /usr/local/etc/bash_completion.d ==> Summary /usr/local/Cellar/node/7.vii.2: 3,148 files, 40.2MB
If yous look above you will see that nosotros have some issues.
macOS provides libicucore.dylib (merely nothing else). If y'all need to take this software first in your PATH run: echo 'consign PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile echo 'consign PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile
So, in final type the following control.
$ echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile $ echo 'consign PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile
We also got an error "Error: The `mash link` step did not complete successfully".
So, type the following command.
$ brew link node
Output
YUSUF-MacBook-Pro:~ yusufshakeel$ brew link node Linking /usr/local/Cellar/node/vii.vii.2... Fault: Could non symlink share/man/man1/node.1 Target /usr/local/share/human/man1/node.1 already exists. You may want to remove it: rm '/usr/local/share/homo/man1/node.1' To forcefulness the link and overwrite all conflicting files: brew link --overwrite node To listing all files that would be deleted: brew link --overwrite --dry-run node
The above output says:
You may desire to remove information technology:
rm '/usr/local/share/man/man1/node.1'
So, utilise the post-obit command.
$ sudo rm '/usr/local/share/man/man1/node.1'
Now, to listing all files that would be deleted use the following command.
$ brew link --overwrite --dry-run node
Output
YUSUF-MacBook-Pro:~ yusufshakeel$ brew link --overwrite --dry-run node Would remove: /usr/local/share/systemtap/tapset/node.stp /usr/local/lib/dtrace/node.d YUSUF-MacBook-Pro:~ yusufshakeel$ brew link --overwrite node Linking /usr/local/Cellar/node/seven.7.2... Fault: Could not symlink share/systemtap/tapset/node.stp /usr/local/share/systemtap/tapset is not writable.
At present nosotros got the Fault: Could non symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is non writable.
To fix this we have to alter the username and group of the systemtap directory.
Blazon the following control in the final.
$ cd /usr/local/share $ sudo chown -R yourusername:yourgroupname systemtap
Output
YUSUF-MacBook-Pro:~ yusufshakeel$ cd /usr/local/share YUSUF-MacBook-Pro:share yusufshakeel$ pwd /usr/local/share YUSUF-MacBook-Pro:share yusufshakeel$ ls -la total 0 drwxrwxr-x 13 root admin 442 Nov 29 00:08 . drwxr-xr-x 25 root wheel 850 Feb 22 10:22 .. drwxrwxr-ten iii root wheel 102 Oct 5 2015 systemtap YUSUF-MacBook-Pro:share yusufshakeel$ sudo chown -R yusufshakeel:admin systemtap Countersign: YUSUF-MacBook-Pro:share yusufshakeel$ ls -la total 0 drwxrwxr-ten thirteen root admin 442 Nov 29 00:08 . drwxr-xr-ten 25 root wheel 850 Feb 22 10:22 .. drwxrwxr-x 3 yusufshakeel admin 102 Oct 5 2015 systemtap
Now, run the --overwrite --dry-run control once again.
$ brew link --overwrite --dry-run node
Output
YUSUF-MacBook-Pro:~ yusufshakeel$ brew link --overwrite --dry out-run node Would remove: /usr/local/share/systemtap/tapset/node.stp /usr/local/lib/dtrace/node.d YUSUF-MacBook-Pro:~ yusufshakeel$ brew link --overwrite node Linking /usr/local/Cellar/node/7.7.2... Mistake: Could not symlink lib/dtrace/node.d /usr/local/lib/dtrace is not writable.
At present, nosotros got the Fault: Could not symlink lib/dtrace/node.d
/usr/local/lib/dtrace is not writable.
To set this we have to change the username and group of the dtrace directory.
In the terminal type in the following control.
$ cd /usr/local/lib $ sudo chown -R yourusername:yourgroupname dtrace
Output
YUSUF-MacBook-Pro:share yusufshakeel$ cd /usr/local/lib YUSUF-MacBook-Pro:lib yusufshakeel$ pwd /usr/local/lib YUSUF-MacBook-Pro:lib yusufshakeel$ ls -la total 52344 drwxrwxr-x 22 root admin 748 Nov 24 12:30 . drwxr-xr-10 25 root wheel 850 February 22 10:22 .. drwxrwxr-ten 3 root wheel 102 Aug 24 2016 dtrace YUSUF-MacBook-Pro:lib yusufshakeel$ sudo chown -R yusufshakeel:admin dtrace YUSUF-MacBook-Pro:lib yusufshakeel$ ls -la total 52344 drwxrwxr-x 22 root admin 748 Nov 24 12:thirty . drwxr-xr-10 25 root cycle 850 Feb 22 x:22 .. drwxrwxr-10 3 yusufshakeel admin 102 Aug 24 2016 dtrace
Now, run the --overwrite --dry-run control again. Hopefully you will become no mistake. Then, its time to run the --overwrite command.
$ brew link --overwrite node
Output
YUSUF-MacBook-Pro:~ yusufshakeel$ brew link --overwrite node Linking /usr/local/Cellar/node/7.vii.2... 7 symlinks created
Congratulation! You have successfully installed NodeJS and NPM on your Mac via Homebrew.
Download Npm for Mac Os X
Posted by: wiremanbeentive.blogspot.com
0 Response to "Download Npm for Mac Os X Updated"
Post a Comment