无法在节点10.16.0上运行Angular-cli

时间:2019-06-12 07:25:44

标签: node.js angular angular-cli angular8

这是我的计算机信息:

  1. 节点版本10.16.0

  2. npm版本6.9.0

  3. 环境变量C:\Users\tran.sonhoang\AppData\Roaming\npm\node_modules\@angular\cli\bin

我的问题是,当我运行ng new app-name时,我将获得包含此信息的文件

#!/usr/bin/env node
'use strict';

// Provide a title to the process in `ps`.
// Due to an obscure Mac bug, do not start this title with any symbol.
try {
  process.title = 'ng ' + Array.from(process.argv).slice(2).join(' ');
} catch(_) {
  // If an error happened above, use the most basic title.
  process.title = 'ng';
}

// Some older versions of Node do not support let or const.
var version = process.version.substr(1).split('.');
if (Number(version[0]) < 10 || (Number(version[0]) === 10 && Number(version[1]) < 9)) {
  process.stderr.write(
    'You are running version ' + process.version + ' of Node.js, which is not supported by Angular CLI 8.0+.\n' +
    'The official Node.js version that is supported is 10.9 or greater.\n\n' +
    'Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.\n'
  );

  process.exit(3);
}

require('../lib/init');

这个问题对我来说太奇怪了,因为这是我第一次看到与angular-cli有关的问题。

我尝试过的事情:

  1. 已删除节点,然后再次安装相同版本。
  2. 删除npm缓存+更新npm
  3. 删除Angular-cli并重新安装

但是它仍然不能解决此问题。任何帮助将不胜感激。谢谢!

0 个答案:

没有答案