Home > Back-end >  npm install Fails With "Command not found" ... ONLY With One Package?
npm install Fails With "Command not found" ... ONLY With One Package?

Time:12-06

This is a weird one. I recently setup a new (Linux) development machine, and normally npm works fine:

$ npm i cheerio
npm WARN ERESOLVE overriding peer dependency
... rest of installation output ...

But when I try to install one specific package, local-ssl-proxy, I get an error:

$ npm i local-ssl-proxy
npm i local-ssl-proxy: command not found

(NOTE: The package is actually designed to be installed globally, but I get the same error when I provide a -g argument.)

I thought at first maybe it was the hyphens, but another hyphenated package works fine:

$ npm i image-size
npm WARN ERESOLVE overriding peer dependency
... rest of installation output ...

Can anyone explain why some some packages would tell me npm doesn't exist, while some wouldn't? I figure it has to be a Bash issue or something (I do have the npm Bash completions installed, although I don't see how they could cause this).

But I just don't see how failing to find the npm command could even be the fault of npm, and how my OS could fail to find npm just for one argument to the command.

CodePudding user response:

This problem wound up fixing itself, so the solution was as strange as the issue. I did however restart my terminal in-between, so that's the only thing I can attribute to the fix.

  • Related