I had this issue this morning, and my solution was to click on the log file.
It showed me this:
2992 verbose type range 2993 verbose stack Error: No valid versions available for undefined 2993 verbose stack at pickManifest (C:\Program Files\choco\nodejs-14\14.17.1.2108041435\node_modules\npm\node_modules\npm-pick-manifest\index.js:39:11) 2993 verbose stack ...etc...
So, I opened the file which threw the exception:
C:\Program Files\choco\nodejs-14\14.17.1.2108041435\node_modules\npm\node_modules\npm-pick-manifest\index.js
and changed line 39 from:
err = new Error(`No valid versions available for ${packument.name}`)
to
err = new Error(`No valid versions available for ${JSON.stringify(packument)}`)
I then re-ran "npm install", and this time, it showed the cause of the problem (I've split the one line into several lines, for readability):
npm ERR! No valid versions available for { "dist-tags":{}, "versions":{}, "success":false, "time":{ "created":"2023-05-15T20:42:01.119Z", "modified":"2023-05-15T20:48:12.712Z" }, "error":"Failed to stream response due to: Missing blob for crypto-js. Unable to check remote crypto-js for retrieving latest copy.", "_cached":true, "_contentLength":0 }
So, this shows me that the cause of the problem is the package:
"crypto-js": "^4.1.1",
So, I needed to grab one of the valid versions from:
https://www.npmjs.com/package/crypto-js?activeTab=versions
You can also see why the error message was so hopeless.
Error: No valid versions available for undefined
Line 39 was attempting to display "name" from this error record, but there was no such field.