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

Error, parse error near `do' when trying to install MacOS

pratik-bhumkar-myob opened this issue · comments

Operating system and version:

nvm debug output:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash 

nvm ls output:

nvm command not found
I cannot install nvm on my system as it errors out with .nvm/nvm.sh:1097: parse error near do'`

How did you install nvm?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

What steps did you perform?

  • Tried reinstalling nvm.
  • Restarting computer.
  • Removing nvm.
  • Trying an old version of nvm, version 3.5 to 3.8

What happened?

I cannot install and use NVM on my mac.

What did you expect to happen?

I expect to install and use NVM

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?

Trying 104.20.23.46:443...
* Connected to nodejs.org (104.20.23.46) port 443
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=*.nodejs.org
*  start date: Feb 28 00:00:00 2024 GMT
*  expire date: Mar 30 23:59:59 2025 GMT
*  subjectAltName: host "nodejs.org" matched cert's "nodejs.org"
*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo RSA Domain Validation Secure Server CA
*  SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://nodejs.org/dist/
* [HTTP/2] [1] [:method: HEAD]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: nodejs.org]
* [HTTP/2] [1] [:path: /dist/]
* [HTTP/2] [1] [user-agent: curl/8.4.0]
* [HTTP/2] [1] [accept: */*]
* [HTTP/2] [1] [accept-encoding: deflate, gzip]
> HEAD /dist/ HTTP/2
> Host: nodejs.org
> User-Agent: curl/8.4.0
> Accept: */*
> Accept-Encoding: deflate, gzip
> 
< HTTP/2 200 
HTTP/2 200 
< date: Tue, 09 Apr 2024 08:45:26 GMT
date: Tue, 09 Apr 2024 08:45:26 GMT
< content-type: text/html
content-type: text/html
< cache-control: public, max-age=3600, s-maxage=14400
cache-control: public, max-age=3600, s-maxage=14400
< last-modified: Tue, 09 Apr 2024 08:05:58 GMT
last-modified: Tue, 09 Apr 2024 08:05:58 GMT
< cf-cache-status: HIT
cf-cache-status: HIT
< age: 2241
age: 2241
< vary: Accept-Encoding
vary: Accept-Encoding
< strict-transport-security: max-age=31536000; includeSubDomains; preload
strict-transport-security: max-age=31536000; includeSubDomains; preload
< x-content-type-options: nosniff
x-content-type-options: nosniff
< server: cloudflare
server: cloudflare
< cf-ray: 871938902f23dfb5-SYD
cf-ray: 871938902f23dfb5-SYD
< content-encoding: gzip
content-encoding: gzip

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

Have you aliased the POSIX command do to something?

I think so there was something to do with the aliases, I didnt have one for do, but removing them all worked.