Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Npm ERR! Invalid version on npm install

Tags:

npm

version

Whenever I run npm install I get

npm ERR! Invalid Version:

This is the log file.

43 verbose stack TypeError: Invalid Version: 
43 verbose stack     at new SemVer (C:\Users\Myself\AppData\Roaming\npm\node_modules\npm\node_modules\semver\classes\semver.js:38:13)
43 verbose stack     at compare (C:\Users\Myself\AppData\Roaming\npm\node_modules\npm\node_modules\semver\functions\compare.js:3:32)
43 verbose stack     at Object.gte (C:\Users\Myself\AppData\Roaming\npm\node_modules\npm\node_modules\semver\functions\gte.js:2:30)
43 verbose stack     at Node.canDedupe (C:\Users\Myself\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\node.js:1054:32)
43 verbose stack     at PlaceDep.pruneDedupable (C:\Users\Myself\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:465:14)
43 verbose stack     at PlaceDep.placeInTree (C:\Users\Myself\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:326:14)
43 verbose stack     at PlaceDep.place (C:\Users\Myself\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:214:10)
43 verbose stack     at new PlaceDep (C:\Users\Myself\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\place-dep.js:71:10)
43 verbose stack     at C:\Users\Myself\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:965:31
43 verbose stack     at Array.map (<anonymous>)
44 verbose cwd C:\Users\Dont\Want\To\Reveal\This\Information
45 verbose Windows_NT 10.0.19042
46 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Myself\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" "-force"
47 verbose node v16.14.0
48 verbose npm  v8.5.1
49 error Invalid Version: 
50 verbose exit 1
51 timing npm Completed in 18500ms

I don't understand what version of what is invalid? Help!

like image 285
kev Avatar asked Aug 31 '25 23:08

kev


1 Answers

Deletingnode_modules and package-lock.json (OR yarn.lock) solved the issue for me.

like image 84
Victor Karangwa Avatar answered Sep 03 '25 17:09

Victor Karangwa