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

NVM problem with corepack and yarn #3328

Closed
MP185496 opened this issue Apr 5, 2024 · 1 comment
Closed

NVM problem with corepack and yarn #3328

MP185496 opened this issue Apr 5, 2024 · 1 comment

Comments

@MP185496
Copy link

MP185496 commented Apr 5, 2024

Operating system and version:

macOS 13.6.2

nvm debug output:

nvm --version: v0.39.5
$TERM_PROGRAM: vscode
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'user'
${HOME}: /Users/user
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${NVM_DIR}/versions/node/v18.15.0/bin:${HOME}/.rbenv/shims:/opt/homebrew/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:${HOME}/Library/Android/sdk/emulator:${HOME}/Library/Android/sdk/platform-tools
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.9 (x86_64-apple-darwin22.0)'
uname -a: 'Darwin 22.6.0 Darwin Kernel Version 22.6.0: Thu Nov 2 07:43:25 PDT 2023; root:xnu-8796.141.3.701.17~6/RELEASE_ARM64_T6020 arm64'
checksum binary: 'shasum'
OS version: macOS 13.6.2 22G320
awk: /usr/bin/awk, awk version 20200816
curl: /usr/bin/curl, curl 8.1.2 (x86_64-apple-darwin22.0) libcurl/8.1.2 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.51.0
wget: not found
sed: /usr/bin/sed
cut: /usr/bin/cut
basename: /usr/bin/basename
rm: /bin/rm
mkdir: /bin/mkdir
xargs: /usr/bin/xargs
git: /usr/bin/git, git version 2.39.3 (Apple Git-145)
grep: /usr/bin/grep, grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
nvm current: v18.15.0
which node: ${NVM_DIR}/versions/node/v18.15.0/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v18.15.0/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v18.15.0
npm root -g: ${NVM_DIR}/versions/node/v18.15.0/lib/node_modules

nvm ls output:

->     v18.15.0
         system
default -> 18.15.0 (-> v18.15.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.15.0) (default)
stable -> 18.15 (-> v18.15.0) (default)
lts/* -> lts/iron (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.1 (-> N/A)
lts/iron -> v20.12.1 (-> N/A)

How did you install nvm?

install script in readme

What steps did you perform?

I tried to enable corepack and install modules
corepack enable
yarn

What happened?

I got error:

Type Error: URL.canParse is not a function
    at parseSpec (/Users/user/.nvm/versions/node/v18.15.0/lib/node_modules/corepack/dist/lib/corepack.cjs:23359:21)
    at loadSpec (/Users/user/.nvm/versions/node/v18.15.0/lib/node_modules/corepack/dist/lib/corepack.cjs:23422:11)
    at async Engine.findProjectSpec (/Users/user/.nvm/versions/node/v18.15.0/lib/node_modules/corepack/dist/lib/corepack.cjs:23606:22)
    at async Engine.executePackageManagerRequest (/Users/user/.nvm/versions/node/v18.15.0/lib/node_modules/corepack/dist/lib/corepack.cjs:23660:20)
    at async BinaryCommand.validateAndExecute (/Users/user/.nvm/versions/node/v18.15.0/lib/node_modules/corepack/dist/lib/corepack.cjs:21164:22)
    at async _Cli.run (/Users/user/.nvm/versions/node/v18.15.0/lib/node_modules/corepack/dist/lib/corepack.cjs:22139:18)
    at async Object.runMain (/Users/user/.nvm/versions/node/v18.15.0/lib/node_modules/corepack/dist/lib/corepack.cjs:24371:12)

What did you expect to happen?

To install node modules

Is there anything in any of your profile files that modifies the PATH?

<!--  (e.g. `.bashrc`, `.bash_profile`, `.zshrc`, etc) -->
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This load$
@ljharb
Copy link
Member

ljharb commented Apr 5, 2024

Note that you need to update nvm; the latest is v0.39.7.

If you're getting an error as a result of using corepack, you need to file an issue on the nodejs/corepack repo - once node's installed, nvm has no impact here.

@ljharb ljharb closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 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