How to fix npm

I tried to install togeojson, but I got the following error:

npm install -g @mapbox/togeojson 

npm ERR! Linux 4.4.0-116-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "@mapbox/togeojson"
npm ERR! node v8.0.0-pre
npm ERR! npm  v3.5.3

npm ERR! Cannot find module 'internal/fs'
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/nboettcher/Downloads/togeojson/npm-debug.log

Other common error is:

npm ERR! Cannot find module 'ansi'

To solve them, you must reinstall nodejs and npm with the following sentences:

sudo apt-get remove nodejs npm
curl -sL | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install npm
npm install

Now I have npm 3.5.2, but now it works.
Enjoy it!


Popular posts from this blog

How to fix Android when developer options are not available for this user

from: can't read /var/mail/ in Python scripts

How to fix VirtualBox error when you try to import an ova file