asdf-nodejs icon indicating copy to clipboard operation
asdf-nodejs copied to clipboard

Unable to Execute `npx` Command

Open arb opened this issue 1 year ago • 6 comments

When trying to use a pretty standard npx command, I'm getting file not found errors. I've tried reshim and resourcing my shell to no avail.

npx browserslist@latest --update-db
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path /Users/xxx/.asdf/installs/nodejs/18.12.1/.npm
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, lstat '/Users/xxx/.asdf/installs/nodejs/18.12.1/.npm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xxx/.npm/_logs/2023-05-17T13_26_41_876Z-debug-0.log

arb avatar May 17 '23 13:05 arb

Hi @arb :wave: Can you try updating asdf and asdf-nodejs?

asdf update
asdf plugin update nodejs

augustobmoura avatar May 17 '23 15:05 augustobmoura

@arb npm isn't initialized, try running npm install -g npm@<your _version> this will generate the dot npm file.

cajual avatar Jun 03 '23 02:06 cajual

@cajual I had the same issue and your solution worked for me! Thank you!

juanestorres avatar Jun 27 '23 03:06 juanestorres

asdf-nodejs is not supposed to use the .npm dir anymore, npm install shouldn't generate a dot npm directory unless we have a bug. This is why I asked that you guys update and test it again. Are you sure you were having this problem even on an updated plugin @juanestorres?

augustobmoura avatar Jun 27 '23 15:06 augustobmoura

I had the same issue and after updating I was able to run npx commands succesfully, thanks @augustobmoura

ricca509 avatar Jul 05 '23 11:07 ricca509

Hi @arb 👋 Can you try updating asdf and asdf-nodejs?

asdf update
asdf plugin update nodejs

Thanks! It worked for me

davidruizdiaz avatar Dec 27 '23 12:12 davidruizdiaz