angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.73k stars 11.98k forks source link

Error while creating new angular project on Fedora 29 machine, Unexpected end of JSON input while parsing near '..."latest","@types/gulp' #13984

Closed amitsamanta2307 closed 5 years ago

amitsamanta2307 commented 5 years ago

🐞 Bug report

Command (mark with an x)

- [X] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: I am not sure, as same version of angular cli is able to create new projects on Windows machine ### Description A clear and concise description of the problem... I installed Fedora 29 on my machine. This is a fresh installation of fedora. Earlier I was using Ubuntu 18.04, on which the angular cli ng new command was working fine. When I try to run "ng new on fedora 29, I am get the following error: npm ERR! Unexpected end of JSON input while parsing near '..."latest","@types/gulp' npm ERR! A complete log of this run can be found in: npm ERR! /home/amit/.npm/_logs/2019-03-25T17_19_38_268Z-debug.log Package install failed, see above. I tried to run, sudo npm cache clean sudo npm install -g @angular/cli@latest No Success Then, I tried sudo npm cache clean --force sudo npm install -g @angular/cli@latest No Success I have updated the node and npm version on the machine, still unable to create new angular project using the angular cli. npm version on my system, 6.9.0 ## πŸ”¬ Minimal Reproduction

Open default terminal on Fedora 29, using bash, run the following command: ng new SportsStore

πŸ”₯ Exception or Error




[amit@dh77eb-fedora29 repos]$ ng new SportsStore
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS
CREATE SportsStore/README.md (1028 bytes)
CREATE SportsStore/.editorconfig (246 bytes)
CREATE SportsStore/.gitignore (629 bytes)
CREATE SportsStore/angular.json (3852 bytes)
CREATE SportsStore/package.json (1311 bytes)
CREATE SportsStore/tsconfig.json (435 bytes)
CREATE SportsStore/tslint.json (1621 bytes)
CREATE SportsStore/src/favicon.ico (5430 bytes)
CREATE SportsStore/src/index.html (298 bytes)
CREATE SportsStore/src/main.ts (372 bytes)
CREATE SportsStore/src/polyfills.ts (2841 bytes)
CREATE SportsStore/src/styles.css (80 bytes)
CREATE SportsStore/src/test.ts (642 bytes)
CREATE SportsStore/src/browserslist (388 bytes)
CREATE SportsStore/src/karma.conf.js (1024 bytes)
CREATE SportsStore/src/tsconfig.app.json (166 bytes)
CREATE SportsStore/src/tsconfig.spec.json (256 bytes)
CREATE SportsStore/src/tslint.json (244 bytes)
CREATE SportsStore/src/assets/.gitkeep (0 bytes)
CREATE SportsStore/src/environments/environment.prod.ts (51 bytes)
CREATE SportsStore/src/environments/environment.ts (662 bytes)
CREATE SportsStore/src/app/app-routing.module.ts (245 bytes)
CREATE SportsStore/src/app/app.module.ts (393 bytes)
CREATE SportsStore/src/app/app.component.css (0 bytes)
CREATE SportsStore/src/app/app.component.html (1152 bytes)
CREATE SportsStore/src/app/app.component.spec.ts (1110 bytes)
CREATE SportsStore/src/app/app.component.ts (215 bytes)
CREATE SportsStore/e2e/protractor.conf.js (752 bytes)
CREATE SportsStore/e2e/tsconfig.e2e.json (213 bytes)
CREATE SportsStore/e2e/src/app.e2e-spec.ts (640 bytes)
CREATE SportsStore/e2e/src/app.po.ts (251 bytes)
npm ERR! Unexpected end of JSON input while parsing near '..."latest","@types/gulp'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/amit/.npm/_logs/2019-03-25T17_19_38_268Z-debug.log
Package install failed, see above.

🌍 Your Environment




Angular CLI: 7.3.6
Node: 10.15.3
OS: linux x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.13.6
@angular-devkit/core         7.3.6
@angular-devkit/schematics   7.3.6
@schematics/angular          7.3.6
@schematics/update           0.13.6
rxjs                         6.3.3
typescript                   3.2.4

Anything else relevant?

Unable to test on the browser, as new project creation fails. error.log

Problem seems to be with the Fedora 29. On my Windows 10, machine, same version of angule cli, I am able to create new angular project.

clydin commented 5 years ago

This seems like a problem with node/npm and not with Angular CLI.

Please have a look at the fixing npm permissions page, common errors page, npm issue tracker, or open a new issue in that issue tracker if the problem you are experiencing isn't known.

amitsamanta2307 commented 5 years ago

Okay. Thank you.

angular-automatic-lock-bot[bot] commented 5 years ago

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.