how can I solve the following error? I use Ubuntu 16. When I run any npm command such as "npm run dev" I get this error:
ERROR: npm is known not to run on Node.js v4.2.6 Node.js 4 is supported but the specific version you're running has a bug known to break npm. Please update to at least ${rel.min} to use this version of npm. You can find the latest release of Node.js at https://nodejs.org/
First, Uninstall completely nodejs and npm.
sudo apt remove nodejs npm
Then, reinstall it over the link below:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
Refer: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
You can try downgrading the node version to switch from the bugged version using the following, upgrading also works if your app supports latest versions.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash
nvm install 4.2.5
nvm use 4.2.5
//check with
node -v
//To uninstall a node version
nvm uninstall 4.2.6
I just had this issue on Ubuntu 16. Use n to update to the latest version
sudo n latest
That should settle it.
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