What fixed my problem was I tried unistalling and re-installing node via brew in mac
npm cache clean
brew uninstall --force node
rm -r /usr/local/lib/node_modules
brew install node
Now if you run "which node"
It should /usr/local/bin/node
And now set NODE_PATH in my .bash_profile as
export NODE_PATH=/usr/local/lib/node_modules
After this it gave me no problem what so ever
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…