当我尝试使用命令
通过终端在angular-cli中创建新项目时Mani-MacBook-Air:angular-project manigupta$ ng new controlgame
显示错误:
module.js:487
throw err;
^
Error: Cannot find module 'rxjs/operators'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/@angular-devkit/core/src/logger/indent.js:10:21)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
请让我知道在angular-cli中创建新项目应该怎么做
答案:
我卸载了angular-cli,然后使用以下命令安装最新版本
sudo npm uninstall -g @ angular / cli
npm cache verify
sudo npm install -g @ angular / cli @ latest
(&#39; sudo&#39;仅适用于mac / linux用户)
答案 0 :(得分:5)
确保您使用的是最新版本的cli
npm install -g @angular/cli@latest