在 Centos 7 上安装 nest.js
Install nest.js on Centos 7
我正在 CentOS 7 上安装 nest.js。我得到这个错误:
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
有什么想法吗?
答案就在错误信息中:
npm ERR! node v6.14.3
不确定您要安装哪个版本的 nest.js
,但当前版本有此要求:
"engines": {
"node": ">= 8.9.0"
},
见官方nest.js
packages.json.
这适用于我的 centos 7。我使用的命令是
[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
我正在 CentOS 7 上安装 nest.js。我得到这个错误:
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
有什么想法吗?
答案就在错误信息中:
npm ERR! node v6.14.3
不确定您要安装哪个版本的 nest.js
,但当前版本有此要求:
"engines": {
"node": ">= 8.9.0"
},
见官方nest.js
packages.json.
这适用于我的 centos 7。我使用的命令是
[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