ng v在cmd中工作,但在vs代码中工作

时间:2019-05-02 17:46:07

标签: node.js visual-studio-code

所以我想创建一个Web应用程序,所以我下载了VS代码和当前版本的node.js,并成功安装了所有程序。 当我在cmd中键入ng v时,我可以查看angular的版本,但是当我打开文件夹并在vs代码中运行相同的命令时,我得到了这样的错误代码

#!/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]) < 8 || (Number(version[0]) === 8 && 
Number(version[1]) < 9)) {
process.stderr.write(
'You are running version ' + process.version + ' of Node.js, which is not supported by Angular CLI v6.\n' +
'The official Node.js version that is supported is 8.9 and 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');

我知道这说节点版本为<8,但我的节点版本为12.1.0,明显大于版本8。我什至尝试卸载并重新安装它,但仍然出现此错误。请帮助我

0 个答案:

没有答案