nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
77.23k stars 7.76k forks source link

Can't install nvm on macOS Mojave (10.14.1) #1944

Open BKeanu1989 opened 5 years ago

BKeanu1989 commented 5 years ago
nvm: command not found

npm ERR! peer dep missing: graphql@^0.13.1, required by @apollographql/apollo-upload-server@5.0.3 npm ERR! peer dep missing: graphql@^0.13.1, required by @apollographql/apollo-upload-server@5.0.3 the complete output:

```sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 12819 100 12819 0 0 91615 0 --:--:-- --:--:-- --:--:-- 92223 => nvm is already installed in /Users/kf/.nvm, trying to update using git => * (HEAD detached at v0.33.11) master => Compressing and cleaning up git repository => nvm source string already in /Users/kf/.bash_profile => bash_completion source string already in /Users/kf/.bash_profile npm ERR! peer dep missing: graphql@^0.13.1, required by @apollographql/apollo-upload-server@5.0.3 npm ERR! peer dep missing: graphql@^0.13.1, required by @apollographql/apollo-upload-server@5.0.3 => You currently have modules installed globally with `npm`. These will no => longer be linked to the active version of Node when you install a new node => with `nvm`; and they may (depending on how you construct your `$PATH`) => override the binaries of modules installed with `nvm`: /usr/local/lib ├── @vue/cli@3.1.3 ├── @vue/cli-init@3.0.0-beta.6 ├── browser-sync@2.18.13 ├── bytewiser@2.1.0 ├── create-guten-block@1.11.0 ├── create-nuxt-app@1.1.1 ├── dat@13.10.0 ├── electron-packager@12.1.0 ├── eslint@4.19.1 ├── gulp-cli@2.0.1 ├── jshint@2.9.5 ├── live-server@1.2.0 ├── localtunnel@1.8.3 ├── madge@3.2.0 ├── snyk@1.88.2 ├── typescript@3.1.3 ├── uglify-js@3.3.15 ├── workbox-cli@3.6.3 └── yarn@1.3.2 => If you wish to uninstall them at a later point (or re-install them under your => `nvm` Nodes), you can remove them from the system Node as follows: $ nvm use system $ npm uninstall -g a_module => Close and reopen your terminal to start using nvm or run the following to use it now: 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 loads nvm bash_completion ```
PATH=/usr/local/git/bin:$PATH

source ~/.bashrc
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 loads nvm bash_completion

*   Trying 2606:4700:10::6814:172e...
* TCP_NODELAY set
* Connected to nodejs.org (2606:4700:10::6814:172e) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
* Server certificate:
*  subject: OU=Domain Control Validated; OU=PositiveSSL Wildcard; CN=*.nodejs.org
*  start date: Aug 14 00:00:00 2017 GMT
*  expire date: Nov 20 23:59:59 2019 GMT
*  subjectAltName: host "nodejs.org" matched cert's "nodejs.org"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fa096006400)
> HEAD /dist/ HTTP/2
> Host: nodejs.org
> User-Agent: curl/7.54.0
> Accept: */*
> Accept-Encoding: deflate, gzip
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200
HTTP/2 200
< date: Sat, 17 Nov 2018 09:29:15 GMT
date: Sat, 17 Nov 2018 09:29:15 GMT
< content-type: text/html
content-type: text/html
< set-cookie: __cfduid=d87167e316de80d99872bae2165ce23e51542446955; expires=Sun, 17-Nov-19 09:29:15 GMT; path=/; domain=.nodejs.org; HttpOnly
set-cookie: __cfduid=d87167e316de80d99872bae2165ce23e51542446955; expires=Sun, 17-Nov-19 09:29:15 GMT; path=/; domain=.nodejs.org; HttpOnly
< cf-cache-status: HIT
cf-cache-status: HIT
< expires: Sat, 17 Nov 2018 13:29:15 GMT
expires: Sat, 17 Nov 2018 13:29:15 GMT
< cache-control: public, max-age=14400
cache-control: public, max-age=14400
< expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
< vary: Accept-Encoding
vary: Accept-Encoding
< server: cloudflare
server: cloudflare
< cf-ray: 47b12bfd59ba2d7d-TXL
cf-ray: 47b12bfd59ba2d7d-TXL
< content-encoding: gzip
content-encoding: gzip

<
* Connection #0 to host nodejs.org left intact

ljharb commented 5 years ago

This suggests you have a system node installed - and that, absent nvm, npm ls -g would error out. If so, that needs to be corrected first.