After upgrading to OS X 10.9 Mavericks, node wasn't found anymore in bash. I think I installed it with brew
a while ago.
I decided to use the installer from node.js website. It went fine and both node
and npm
became available in bash. However, installing packages globally doesn't work.
The npm -g bin
outputs following path /usr/local/bin
.
However, after running npm install -g karma
and invoking ls -la /usr/local/bin
I can't see a symlink to the path where karma
executable resides.
Running npm -g root
returns /usr/local/lib/node_modules
and after the installation I can see that karma
module is there.
Not sure what I else I could check. Thanks!
The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.
In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) as a global package. By default, npm install will install all modules listed as dependencies in package. json .
Install Package Globally NPM can also install packages globally so that all the node. js application on that computer can import and use the installed packages. NPM installs global packages into /<User>/local/lib/node_modules folder. Apply -g in the install command to install package globally.
I had the same problem due to not accepting the xcode license after upgrading to Mavericks. I was able to accept the new xcode license by running the following:
sudo xcodebuild -license
However, npm still was not working because symlink was not created, but trying to reinstall said npm was already there. I went ahead and:
brew remove npm
and then reinstalled with:
brew install npm
and I am back working again. Not a big fan of the reinstall, but I think the need to accept the xcode license left things in a hung state.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With