3
votes

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)

1
Please note that angularjs refers to angular 1.x and angular refers to angular version 2 and later.Igor
are you using angular-cli ?check this link for guide https://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 run npm update if rxjs is already in package.jsonNiladri
yeah..I m usingMani Gupta
@ManiGupta check this link github.com/angular/angular-cliNiladri
Make sure you are using the latest version of the cli: npm 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

1 Answers

7
votes

Make sure you are using the latest version of the cli

npm install -g @angular/cli@latest