npm command not found after updating to Mac OSX 10

2019-04-11 10:49发布

问题:

I can't do npm command on terminal after updating my OS to Mavericks.

when I try this: node /usr/local/lib/node_modules/npm/bin/npm-cli.js -v it is working and showing the version 1.4.3

I don't know what's happening here, can anyone help me? Thanks

回答1:

Try relinking the bin:

ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/bin/npm

You might need to run as root.