Error installing angular/cli on macOS mojave - node-pre-gyp
Well I did this and it worked for me.
- rm -rf /usr/local/lib/node_modules
- brew uninstall node
- brew install node --without-npm
- echo prefix=~/.npm-packages >> ~/.npmrc
- curl -L https://www.npmjs.com/install.sh | sh
add the following line to your ~/.bash_profile (export PATH="$HOME/.npm-packages/bin:$PATH")
Unistall your current @angular/cli (sudo npm uninstall -g @angular/cli)
- npm cache clean --force / npm cache verify
- xcode-select --install
- npm install -g node-gyp
- npm install -g @angular/cli (without sudo).
Let me know if it works
You're not doing anything wrong, there is some error related to (probably) fsevents, both official package from node.js (lts and current) and homebrew installs have this issue.
Follow answers on this thread: How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
[basically you need to remove node, npm, ng files and folders manually]
and install nvm and then node with nvm.