简体   繁体   中英

Installing Node.JS on Mac

I'm trying to install Node.JS on Mac OSX 10.9.3 by following the steps on this website .

When I type the following command:

git clone git://github.com/ry/node.git

I am getting the following error:

fatal: destination path 'node' already exists and is not an empty directory.

How do I resolve this?

It means there's already a folder called "node" in your current folder. Either delete it, or move to another folder and try again.

As a side comment, try installing Node (and any other software) using a package manager like Homebrew or MacPorts , for easier installation/uninstallation experience.

Install Node.js on Mac zsh

Using Homebrew:

brew install node

If you want to download the package with bash:

curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"

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