when i am trying to create new project in angular-cli by terminal using command
Mani-MacBook-Air:angular-project manigupta$ ng new controlgame
showing error:
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)
Please let me know what I should do to create new project in angular-cli
Answer:
I uninstalled the angular-cli then install with latest version using following command
sudo npm uninstall -g @angular/cli
npm cache verify
sudo npm install -g @angular/cli@latest
('sudo' is only for mac/linux user)
angularjs
refers to angular 1.x andangular
refers to angular version 2 and later. – Igorangular-cli
?check this link for guidehttps://github.com/angular/angular-cli
if you are using angular cli . it creates a package.json inside your project folder by default .you have to change directory to your project folder and then runnpm update
if rxjs is already in package.json – Niladrinpm install -g @angular/cli@latest
. Also update your question with the relevant information, do not put it in the comments where it can be easily missed and the formatting is confusing to read. – Igor