1

I am installing nest.js on CentOS 7. I get this error:

file:///usr/lib/node_modules/@nestjs/cli/node_modules/@nuxtjs/opencollective/src/index.js:7
  ;(async () => {
          ^

SyntaxError: Unexpected token (
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.2 (node_modules/@nestjs/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 3.10.0-693.21.1.el7.x86_64
npm ERR! argv "/usr/bin/node" "/bin/npm" "i" "-g" "@nestjs/cli"
npm ERR! node v6.14.3
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! @nestjs/cli@5.5.0 postinstall: `opencollective`
npm ERR! Exit status 1

Any idea?

frhd
  • 9,396
  • 5
  • 24
  • 41
Abdollah
  • 4,579
  • 3
  • 29
  • 49

2 Answers2

1

The answer lies right in the error message:

npm ERR! node v6.14.3

Not sure which version of nest.js you are trying to install, but the current version has this requirement:

"engines": {
  "node": ">= 8.9.0"
},

See official nest.js packages.json.

frhd
  • 9,396
  • 5
  • 24
  • 41
0

This works on my centos 7. The command that I used are

[root@yellowdog ~]# npm install -g @nestjs/cli
/usr/bin/nest -> /usr/lib/node_modules/@nestjs/cli/bin/nest.js

> @nestjs/cli@5.5.0 postinstall /usr/lib/node_modules/@nestjs/cli
> opencollective

                          Thanks for installing nest 
                 Please consider donating to our open collective
                        to help us maintain this package.

                            Number of contributors: 54
                              Number of backers: 97
                            Annual budget: US$ 37,495
                             Current balance: US$ 246

         Become a partner: https://opencollective.com/nest/donate

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/@nestjs/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @nestjs/cli@5.5.0
added 215 packages from 173 contributors in 20.529s
[root@yellowdog ~]# node -v
v8.11.4
[root@yellowdog ~]# npm -v
6.4.1
[root@yellowdog ~]# nest --version
5.5.0
Manish R
  • 2,312
  • 17
  • 13