nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot install node

omidshojaee opened this issue · comments

Operating system and version: macOS Ventura 13.1

nvm debug output:

nvm --version: v0.39.2
$TERM_PROGRAM: Apple_Terminal
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'omid'
${HOME}: /Users/omid
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: /usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.8.1 (x86_64-apple-darwin22.0)'
uname -a: 'Darwin 22.2.0 Darwin Kernel Version 22.2.0: Fri Nov 11 02:08:47 PST 2022; root:xnu-8792.61.2~4/RELEASE_X86_64 x86_64'
checksum binary: 'shasum'
OS version: macOS 13.1 22C65
curl: /usr/bin/curl, curl 7.85.0 (x86_64-apple-darwin22.0) libcurl/7.85.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.11 nghttp2/1.47.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.37.1 (Apple Git-137.1)
grep: /usr/bin/grep, grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
awk: /usr/bin/awk, awk version 20200816
nvm current: none
which node: node not found
which iojs: iojs not found
which npm: npm not found
npm config get prefix: nvm:298: command not found: npm
npm root -g: nvm:298: command not found: npm

nvm ls output:

            N/A
mkdir: /Users/omid/.nvm/alias: Permission denied
mkdir: /Users/omid/.nvm/alias: Permission denied
iojs -> N/A (default)
node -> stable (-> N/A) (default)
unstable -> N/A (default)

How did you install nvm? install script in readme.

What steps did you perform?

nvm install node

What happened?

mkdir: /Users/omid/.nvm/alias: Permission denied
mkdir: /Users/omid/.nvm/alias: Permission denied
mkdir: /Users/omid/.nvm/alias: Permission denied
Downloading and installing node v19.3.0...
mkdir: /Users/omid/.nvm/.cache: Permission denied
creating directory /Users/omid/.nvm/.cache/bin/node-v19.3.0-darwin-x64/files failed
Downloading https://nodejs.org/dist/v19.3.0/node-v19.3.0-darwin-x64.tar.xz...
Warning: Failed to open the file                                                                                                 
Warning: /Users/omid/.nvm/.cache/bin/node-v19.3.0-darwin-x64/node-v19.3.0-darwi
Warning: n-x64.tar.xz: No such file or directory
curl: (23) Failure writing output to destination

Binary download from https://nodejs.org/dist/v19.3.0/node-v19.3.0-darwin-x64.tar.xz failed, trying source.
grep: /Users/omid/.nvm/.cache/bin/node-v19.3.0-darwin-x64/node-v19.3.0-darwin-x64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 8 CPU core(s)
Running with 7 threads to speed up the build
Clang v3.5+ detected! CC or CXX not specified, will use Clang as C/C++ compiler!
mkdir: /Users/omid/.nvm/.cache: Permission denied
creating directory /Users/omid/.nvm/.cache/src/node-v19.3.0/files failed
Downloading https://nodejs.org/dist/v19.3.0/node-v19.3.0.tar.xz...
Warning: Failed to open the file                                                                                                 
Warning: /Users/omid/.nvm/.cache/src/node-v19.3.0/node-v19.3.0.tar.xz: No such 
Warning: file or directory
                                                                                                                              0.0%curl: (23) Failure writing output to destination

Binary download from https://nodejs.org/dist/v19.3.0/node-v19.3.0.tar.xz failed, trying source.
grep: /Users/omid/.nvm/.cache/src/node-v19.3.0/node-v19.3.0.tar.xz: No such file or directory
Provided file to checksum does not exist.

What did you expect to happen?

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

If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?

Looks like you're getting permissions error inside $NVM_DIR. Please make sure that you have full ownership of $HOME, and try again?

Already checked that.

And if I don't have full ownership of $HOME the whole system won't work.

@omidshojaee can you verify the same for $NVM_DIR? (systems work fine with a read-only $HOME, so i don't think that's a valid assertion, but it's not relevant here)

I just ran into this issue after a fresh Kubuntu install. Then I remembered I installed curl with snap instead of apt, so I reinstalled it with apt and everything works now.