Trouble installing node.js onto mac

Showing 1-2 of 2 messages
Trouble installing node.js onto mac JD 10/4/12 3:12 AM

Either by running the mac installer or building from source, I cannot get npm to work on os x mountain lion. When building from source I get the following error:


symlinking ../lib/node_modules/npm/bin/npm-cli.js -> /usr/local/bin/npm
updating shebang of /usr/local/bin/npm to /usr/local/bin/node
Traceback (most recent call last):
  File "tools/install.py", line 225, in <module>
    run(sys.argv[:])
  File "tools/install.py", line 220, in run
    if cmd == 'install': return files(install)
  File "tools/install.py", line 203, in files
    if 'true' == variables.get('node_install_npm'): npm_files(action)
  File "tools/install.py", line 166, in npm_files
    update_shebang(link_path, shebang)
  File "tools/install.py", line 133, in update_shebang
    s = open(path, 'r').read()
IOError: [Errno 2] No such file or directory: '/usr/local/bin/npm'

Here's what npm looks like in /usr/local/bin:

lrwxr-xr-x  1 root  wheel  38 Oct  2 16:15 npm -> ../lib/node_modules/npm/bin/npm-cli.js

  When using the automated installer, everything goes smoothly. When typing 'npm' to the command line I get a command not found error. Any help would be greatly appreciated.

-JD

Re: Trouble installing node.js onto mac Wil Moore 10/4/12 9:49 PM
Hi JD,



Either by running the mac installer or building from source, I cannot get npm to work on os x mountain lion. When building from source I get the following error:

You might want to give one of the binary tarball packages a shot (though it shouldn't be much different from the installer package). I've only every installed this way and I've never had an issue. If you don't want to do this manually and/or don't want to know the details, you can use a package (https://github.com/wilmoore/nodejs-latest) I wrote that will allow you to quickly install the latest NodeJS binary package. If you have trouble, open an issue.

That being said, even if you do end up using the distributed install or something like `nodejs-latest`, I would encourage you to pick them all apart and understand what they are doing to your system. You'll be better equipped to diagnose problems when they arise and you'll be better equipped to help others when they have issues.

Good luck to you,


--Wil Moore III