npm install 报错 The package-lock.json file was created with an old version of npm, npm WARN o

1. Problem background

The solution is to look directly at 3
The blogger reported an error when downloading the package with the npm install command in VScode, the error is as follows

npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.       
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile

changed 1 package, and audited 2 packages in 6s

found 0 vulnerabilities

2. The reason for the error

The npm version is too high, the solution is as follows, the pro-test is effective and can be solved.

3. Solution

1. Enter the following command line in the vscode terminal (you can copy and paste directly)

npm i npm@6 -g

2.then type

npm -v

Checking the npm version will show a lower npm version number.
insert image description here
3. Then perform the npm install operation and no error will be reported.

Reference blog address:

https://docker.blog.csdn.net/article/details/120564807?spm=1001.2014.3001.5506

Supplement other problems encountered

  1. If found 0 vulnerabilities is displayed, it means that the package has already been installed, and there is no need to install it again. The package can be found in the node_modues directory in the current directory.

Guess you like

Origin blog.csdn.net/dxy1128/article/details/126024025
NPM