angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Failed to create new Angular 6 project - macOS (High Sierra)

Open hpardess opened this issue 8 years ago • 11 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Area

- [x] devkit
- [x] schematics

Versions

node : v8.11.3 npm : 6.1.0 Angular CLI : 6.0.8 OS : macOS (High Sierra)

Repro steps

ng new testappp

The log given by the failure

$ ng new testappp CREATE testappp/README.md (1025 bytes) CREATE testappp/angular.json (3566 bytes) CREATE testappp/package.json (1312 bytes) CREATE testappp/tsconfig.json (384 bytes) CREATE testappp/tslint.json (2805 bytes) CREATE testappp/.editorconfig (245 bytes) CREATE testappp/.gitignore (503 bytes) CREATE testappp/src/environments/environment.prod.ts (51 bytes) CREATE testappp/src/environments/environment.ts (631 bytes) CREATE testappp/src/favicon.ico (5430 bytes) CREATE testappp/src/index.html (295 bytes) CREATE testappp/src/main.ts (370 bytes) CREATE testappp/src/polyfills.ts (3194 bytes) CREATE testappp/src/test.ts (642 bytes) CREATE testappp/src/assets/.gitkeep (0 bytes) CREATE testappp/src/styles.css (80 bytes) CREATE testappp/src/browserslist (375 bytes) CREATE testappp/src/karma.conf.js (964 bytes) CREATE testappp/src/tsconfig.app.json (194 bytes) CREATE testappp/src/tsconfig.spec.json (282 bytes) CREATE testappp/src/tslint.json (314 bytes) CREATE testappp/src/app/app.module.ts (314 bytes) CREATE testappp/src/app/app.component.css (0 bytes) CREATE testappp/src/app/app.component.html (1141 bytes) CREATE testappp/src/app/app.component.spec.ts (991 bytes) CREATE testappp/src/app/app.component.ts (207 bytes) CREATE testappp/e2e/protractor.conf.js (752 bytes) CREATE testappp/e2e/src/app.e2e-spec.ts (304 bytes) CREATE testappp/e2e/src/app.po.ts (208 bytes) CREATE testappp/e2e/tsconfig.e2e.json (213 bytes) npm WARN deprecated [email protected]: 1.2.0 should have been a major version bump npm ERR! Unexpected end of JSON input while parsing near '...mpiler-cli","version"'

npm ERR! A complete log of this run can be found in: npm ERR! /Users/dream/.npm/_logs/2018-06-23T19_05_28_356Z-debug.log Package install failed, see above.

Desired functionality

Failed to create a new angular 6 project.

Mention any other details that might be useful

hpardess avatar Jun 23 '18 19:06 hpardess

Were you connected to the internet while creating the new app?

elonaire avatar Jun 23 '18 21:06 elonaire

Yes, I was connected to internet while creating the new app. Before app creation, I have successfully installed the cli (npm install -g @angular/cli).

hpardess avatar Jun 24 '18 12:06 hpardess

try installing yarn ......................................................... npm install -g yarn

elonaire avatar Jun 24 '18 12:06 elonaire

And then enter the command 'ng new testappp' after yarn has completed installation

elonaire avatar Jun 24 '18 12:06 elonaire

what if you don't use yarn?

grimace avatar Jun 24 '18 17:06 grimace

  • installed Node.js v10.5.0 and npm v6.1.0 (https://nodejs.org/en/)
  • npm install -g @angular/cli
  • sudo npm install -g yarn
  • ng new testappp (It still failed like before but i open the directory and installed the packages through yarn as bellow commands)
  • cd testappp
  • yarn install
  • ng serve --open

It worked. @elonaire : Thanks for suggesting yarn.

hpardess avatar Jun 24 '18 17:06 hpardess

a similar looking error happened on my machine, which I have opened as another issue. it seems like the culprit may have to do with deprecated istanbul? that's where mine fails too

johren02 avatar Jul 08 '18 18:07 johren02

Duplicate of #11498

johren02 avatar Jul 08 '18 18:07 johren02

my issue was also solved by installing yarn. however, it would be nice to know that yarn is a required dependency of @angular/cli, or otherwise making it not required and fixing this install issue

johren02 avatar Jul 08 '18 19:07 johren02

yarn is not a requirement. NPM 6.x is not yet stable and there were a few regressions in NPM itself. Nothing we can do, unfortunately. Try reverting to NPM 5 or use the latest NPM 6 (but there might be other issues).

hansl avatar Jul 17 '18 14:07 hansl

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.