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

Cannot find module '/Users/me/.nvm/versions/Library/pnpm/global/5/node_modules/pnpm/bin/pnpm.cjs' #4759

Open
apottere opened this issue May 18, 2022 · 9 comments

Comments

@apottere
Copy link

pnpm version:

7.1.1

Code to reproduce the issue:

$ npm i -g pnpm
$ pnpm --config.global-bin-dir=/Users/me/.nvm/current/bin i -g pnpm
$ pnpm --config.global-bin-dir=/Users/me/.nvm/current/bin i -g pnpm

Expected behavior:

The second pnpm install works

Actual behavior:

$ npm i -g pnpm

changed 1 package, and audited 2 packages in 664ms

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

$ pnpm --config.global-bin-dir=/Users/me/.nvm/current/bin i -g pnpm
Nothing to stop. No server is running for the store at /Users/me/Library/pnpm/store/v3
The location of the currently running pnpm differs from the location where pnpm will be installed
 Current pnpm location: /Users/me/.nvm/versions/node/v16.14.0/bin
 Target location: /Users/me/.nvm/current/bin

Already up-to-date
Progress: resolved 96, reused 96, downloaded 0, added 0, done

$ pnpm --config.global-bin-dir=/Users/me/.nvm/current/bin i -g pnpm
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '/Users/me/.nvm/versions/Library/pnpm/global/5/node_modules/pnpm/bin/pnpm.cjs'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Additional information:

Possibly related to #4744

  • node -v prints: v16.14.0
  • Windows, macOS, or Linux?: macOS 12.4 (21F79)
@nikitavoloboev
Copy link

nikitavoloboev commented May 21, 2022

Hitting this as well. Is it possible to downgrade pnpm version from CLI? Or there is some pnpm version manager separate utility we can use?

@zkochan
Copy link
Member

zkochan commented May 21, 2022

All the supported installation methods are listed on this page: https://pnpm.io/installation

try to use an alternative method for now.

@zkochan
Copy link
Member

zkochan commented May 21, 2022

I see you have PNPM_HOME declared twice. You may remove the two pnpm related lines below Deno.

Check the value of the PATH env variable and whether /Users/nikiv/Library/pnpm is at the beginning.

@zkochan
Copy link
Member

zkochan commented May 21, 2022

If pnpm is used from /opt/homebrew/bin/pnpm, maybe you should update pnpm with Homebrew

@nikitavoloboev
Copy link

Deleted the comment before seeing your reply as it was my bad. I had to ran exec zsh to reload the shell. It works now and uses correct path /Users/nikiv/Library/pnpm/pnpm. OP's issue still stand though so can't use brew version yet.

@apottere
Copy link
Author

Just tested with pnpm 7.3.0, and this is still an issue. For now installing pnpm with npm every time works though.

@hanwenbo
Copy link

hanwenbo commented Aug 5, 2022

link causes

@shunyue1320
Copy link

shunyue1320 commented Aug 27, 2022

I have always been able to update, not until now
node: v16.13.0
pnpm:7.0.0
image

@vaynevayne
Copy link

same , i use nvm, when i change node version, the pnpm -v can change sometime, but can't remove pnpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants