8

I was trying to install mysql for npm with the comand npm install mysql, then I receive this error message:

npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN using --force I sure hope you know what you are doing.

My version of node.js is 10.15.2 and the version of npm is 5.8.0. I think the problem is that they are not compatible. I was trying to update node, but I didn't succed in it. Solutions?

I have switched to a newer version of nodejs, the twelve one, with this code:

curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs

The problem is that I still can't download mysql for npm. The message is:

npm WARN saveError ENOENT: no such file or directory, open '/home/dario/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/dario/package.json'
npm WARN dario No description
npm WARN dario No repository field.
npm WARN dario No README data
npm WARN dario No license field.

+ mysql@2.17.1
updated 1 package and audited 32 packages in 1.447s
found 0 vulnerabilities
wjandrea
  • 14,236
  • 4
  • 48
  • 98

2 Answers2

8

Well i face the same problem today after install ubuntu 19.10. and i solve this by updating npm using below command

npm install -g npm@latest

For more details you can check this issue in github

npm version issue

Hope it will help

sayalok
  • 291
0

You can install the latest LTS Node.js on Ubuntu using the following command:

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -

This method is indicated in the official documentation.

Node.js binary distributions

If you need many versions of nodejs at the same time Recommend using nvm (git nvm) install

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

Example of use

install 16 node

nvm install 16

list of installed

nvm ls

Selection of the version you need at the moment

nvm use 16

This way you can easily change the version. For compatibility with project packages.

F00x
  • 17
  • 2
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Mitch Nov 18 '21 at 16:24