Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find npm cli directory #258

Closed
samschurter opened this issue Nov 22, 2024 · 6 comments
Closed

Unable to find npm cli directory #258

samschurter opened this issue Nov 22, 2024 · 6 comments
Assignees

Comments

@samschurter
Copy link

I recently upgraded to socket v0.14.27 and now i'm getting the following error in some directories:

Unable to find npm cli install directory, this is potentially a bug with socket-npm caused by changes to the npm cli.
Searched parent directories of /Users/sschurter/.nvm/versions/node/v22.5.1/lib/node_modules/socket/bin/npm

It does work in some directories.

My environment

❯ socket --version
0.14.27
❯ node --version
v22.5.1
❯ npm --version
10.8.2
@jdalton jdalton self-assigned this Dec 2, 2024
@jdalton
Copy link
Collaborator

jdalton commented Dec 2, 2024

Hi @samschurter 👋

Which version were you on where things were working?

@samschurter
Copy link
Author

@jdalton Unfortunately I do not know. When upgrading from Node 20 -> 22, I had some issue with the socket CLI and was in a hurry so I just disabled the alias, then forgot about it. Then a team member recently reminded me and I did a fresh install and it mostly works, there's just the occasional directory it breaks in.

@jdalton
Copy link
Collaborator

jdalton commented Dec 11, 2024

Thank you @samschurter!

We resolve the npmRoot directory by taking our directory

/Users/sschurter/.nvm/versions/node/v22.5.1/lib/node_modules/socket

and walking back until we find a npm folder which is usually found in /Users/sschurter/.nvm/versions/node/v22.5.1/lib/node_modules/.

@samschurter Please check your /Users/sschurter/.nvm/versions/node/v22.5.1/lib/node_modules/ folder and see if there is a npm folder there or where it exists if you do which npm and report back.

@samschurter
Copy link
Author

❯ which npm
/Users/sschurter/.nvm/versions/node/v22.5.1/bin/npm

I also confirmed that NPM does exist in the /Users/sschurter/.nvm/versions/node/v22.5.1/lib/node_modules/npm folder. This has always been an intermittent issue for me, and right now I cannot recreate it even though I have not upgraded anything. A teammate @camden-obertop is able to recreate the error with version 0.14.27.

❯ which npm
/Users/cobertop/.nvm/versions/node/v20.18.1/bin/npm

However, upgrading to v0.14.33 resolved the issue. I'm going to upgrade as well and see if that fixes the issue. I will report back if I or anybody on the team runs into the issue again.

@jdalton
Copy link
Collaborator

jdalton commented Dec 11, 2024

Thank you @samschurter!

@jdalton
Copy link
Collaborator

jdalton commented Dec 14, 2024

Closing for now.

@jdalton jdalton closed this as completed Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants