I tried to install express-generator using the command npm install express-generator but I get the following error. I searched in the web and could not find any helpful answers for this.
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! Unexpected end of JSON input while parsing near '...DHZShvBYWKIIktsiBUuRD'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ASUS\AppData\Roaming\npm-cache\_logs\2020-07-12T10_29_10_754Z-debug.log
The WARN has nothing to do with the rest of the message. It's only that, a WARN, and it should be given to package mantainers using outdated deps, not you.
The ERR(s) is saying npm could not parse a JSON content somewhere and not much else.
Before digging into the logfile it's showing you, try cleaning your cache to cover the not uncommon case in which a cache entry is corrupted or inconsistent and npm crashes just because it's trying to be more efficient.
Given you're using window, open a console as administrator (both CMD and Powershell should work, but I don't have a windows machine atm) and run
Alternatively, running
Will, among other checks, verify the cached packages and pinpoint the corrupt or inconsistent ones.
It wouldn't hurt to also update your npm version to the latest one using
When you're done, try running express-generator again.