3

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)

13
  • 1
    Please note that angularjs refers to angular 1.x and angular refers to angular version 2 and later. Commented Jan 24, 2018 at 18:13
  • 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.json Commented Jan 24, 2018 at 18:19
  • yeah..I m using Commented Jan 24, 2018 at 18:22
  • @ManiGupta check this link github.com/angular/angular-cli Commented Jan 24, 2018 at 18:23
  • 2
    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. Commented Jan 24, 2018 at 19:31

1 Answer 1

7

Make sure you are using the latest version of the cli

npm install -g @angular/cli@latest
Sign up to request clarification or add additional context in comments.

4 Comments

exactly operators is not a module
but the question is about creating a new module not while using
@Sajeetharan op never mentioned something about creating a new module
Actually, with Angular5 there is now an rxjs/operators, and it is the proper way to use it with 5+

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.