asdf-vm / asdf-nodejs

Node.js plugin for asdf version manager

Home Page:https://github.com/asdf-vm/asdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to Execute `npx` Command

arb opened this issue · 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

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

asdf update
asdf plugin update nodejs

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

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

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?

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

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

asdf update
asdf plugin update nodejs

Thanks! It worked for me