javascript - Angular Cli ng serve don't work -


when try run ng serve got error :

the "@angular/compiler-cli" package not installed. error:  typeerror : object prototype may object or null: undefined error: "@angular/compiler-cli" package not installed.  error: ty peerror: object prototype may object or null: undefined @ object.<anonymous> (c:\users\mounadi\angular2-quickstart\node_modules\@ng tools\webpack\src\index.js:14:11) @ module._compile (module.js:570:32) @ object.module._extensions..js (module.js:579:10) @ module.load (module.js:487:32) @ trymoduleload (module.js:446:12) @ function.module._load (module.js:438:3) @ module.require (module.js:497:17) @ require (internal/module.js:20:19) @ object.<anonymous> (c:\users\mounadi\angular2-quickstart\node_modules\@an gular\cli\tasks\eject.js:10:19) @ module._compile (module.js:570:32) @ object.module._extensions..js (module.js:579:10) @ module.load (module.js:487:32) @ trymoduleload (module.js:446:12) @ function.module._load (module.js:438:3) @ module.require (module.js:497:17) @ require (internal/module.js:20:19) 

i tried uninstall @angular/cli , install @angular/cli@latest , got same error

follow below steps start angular cli.

first update node version:

  1. so, first check node version typing command node -v.
  2. if node version lower 6.x.x update because angular cli requires node version higher 6.x.x. update node version run below command.

    nvm install <new version> --reinstall-packages-from=<old version>

    ex: nvm install 7.10.0 --reinstall-packages-from=5.1.0

    then run command: nvm use 7.10.0

  3. after run command npm install -g @angular/cli install angular cli.

  4. then ng new my-new-project create new project.
  5. then cd my-new-project go inside created project directory.
  6. and ng serve run app.

extra: update angular 2 project angular 4 project run below command:

    * on linux/mac: npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-                          server,router,animations}@next --save server,router,animations}@next --save       * on windows: npm install @angular/common@next @angular/compiler@next @angular/compiler-cli@next @angular/core@next                     @angular/forms@next @angular/http@next @angular/platform-browser@next @angular/platform-browser-dynamic@next                     @angular/platform-server@next @angular/  router@next @angular/animations@next --save 

Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -