如何在centos 7上安装Angular

如何在centos 7上安装Angular

安装 npm v6.12.0 和 Node v10.3.0 后,我开始在我的机器 centos 7 上安装 Angular

当涉及到执行时,会出现以下异常:

[root@localhost ~]#  npm install -g @angular/cli
npm ERR! require(...) is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-10-29T10_59_52_968Z-debug.log
[root@localhost ~]# 

您能告诉我如何安装 Angular 以便我的 Linux 服务器可以成为我的 Web 应用程序的 UAT 测试服务器吗?

已编辑”这是日志 2019-10-29T10_59_52_968Z-debug.log :

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   '@angular/cli' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 2f7732aa44efb148
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 verbose stack TypeError: require(...) is not a function
7 verbose stack     at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/columnify/node_modules/strip-ansi/index.js:2:38)
7 verbose stack     at Module._compile (internal/modules/cjs/loader.js:702:30)
7 verbose stack     at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
7 verbose stack     at Module.load (internal/modules/cjs/loader.js:612:32)
7 verbose stack     at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
7 verbose stack     at Function.Module._load (internal/modules/cjs/loader.js:543:3)
7 verbose stack     at Module.require (internal/modules/cjs/loader.js:650:17)
7 verbose stack     at require (internal/modules/cjs/helpers.js:20:18)
7 verbose stack     at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/columnify/width.js:1:79)
7 verbose stack     at Module._compile (internal/modules/cjs/loader.js:702:30)
7 verbose stack     at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
7 verbose stack     at Module.load (internal/modules/cjs/loader.js:612:32)
7 verbose stack     at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
7 verbose stack     at Function.Module._load (internal/modules/cjs/loader.js:543:3)
7 verbose stack     at Module.require (internal/modules/cjs/loader.js:650:17)
7 verbose stack     at require (internal/modules/cjs/helpers.js:20:18)

相关内容