Chaklader
Chaklader

Reputation: 169

Cant create project using the ng new command

I'm trying to create an Angular project using the command

ng new my

The creation starts but the get stuck at some point and never ends. I get the following terminal outputs,

Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
installing ng2
  create .editorconfig
  create README.md
  create src/app/app.component.css
  create src/app/app.component.html
  create src/app/app.component.spec.ts
  create src/app/app.component.ts
  create src/app/app.module.ts
  create src/app/index.ts
  create src/app/shared/index.ts
  create src/assets/.gitkeep
  create src/assets/.npmignore
  create src/environments/environment.prod.ts
  create src/environments/environment.ts
  create src/favicon.ico
  create src/index.html
  create src/main.ts
  create src/polyfills.ts
  create src/styles.css
  create src/test.ts
  create src/tsconfig.json
  create src/typings.d.ts
  create angular-cli.json
  create e2e/app.e2e-spec.ts
  create e2e/app.po.ts
  create e2e/tsconfig.json
  create .gitignore
  create karma.conf.js
  create package.json
  create protractor.conf.js
  create tslint.json
Successfully initialized git.
Installing packages for tooling via npm.

After the last line, it stops forever and I quit after providing 10 minutes of time. Though the files are generated properly and when I run ng server I get the errors,

1st time: it count find the portfinder 
2nd time:  module.js:327
    throw err;
    ^
Error: Cannot find module 'ember-cli/lib/cli'

I assume I need to provide more time to Installing packages for tooling or is there something else. This is the first time I use Angular and hence, slightly confused about the issue. Thanks.

EDIT:

I again tried and waits long enough to get the following error message,

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package @angular/[email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected]
npm ERR! peerinvalid Peer @angular/[email protected] wants @angular/[email protected]

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Chaklader/Desktop/my/npm-debug.log

Package install failed, see above.

WHAT SHOULD I DO TO RESOLVE THE ISSUE?

Upvotes: 2

Views: 1679

Answers (1)

jiangke
jiangke

Reputation: 355

You can follow the next steps and solve your problem:

  1. In old version of angular-cli you just use ng new App --skip-npm to avoid install. For latest version you can use ng new App --skip-install instead;
  2. Get into the directory use cd Appand and then installed npm via npm install.
  3. Wait for minutes to let the installation to complete. With using CLI, here is how to compile and run it ng serve.

I solved the problem with reference to this solution-angular-ng-new-command-stuck-at-installing-packages-for-tooling-via-npm.

Upvotes: 1

Related Questions