这是我的电脑信息:
节点版本 10.16.0
npm 版本 6.9.0
环境变量
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 的这个问题。
我试过的:
- 删除节点并再次安装相同的版本。
- 删除 npm 缓存 + 更新 npm
- 删除 Angular-cli 并重新安装
但它仍然不能解决这个问题。任何帮助将不胜感激。谢谢!