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

Could not create new project "ng new"

Open ragavanrandy opened this issue 6 years ago β€’ 9 comments

🐞 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?

Description

create new project using angular cli 8.3.9

πŸ”¬ Minimal Reproduction

1. ng new test 2. npm install

πŸ”₯ Exception or Error


1. ng new test

E:\Projects\angular\others>ng new test
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS   [ https://sass-lang.com/documentation/syntax#scss
 ]
CREATE test/angular.json (3665 bytes)
CREATE test/package.json (1278 bytes)
CREATE test/README.md (1021 bytes)
CREATE test/tsconfig.json (543 bytes)
CREATE test/tslint.json (1953 bytes)
CREATE test/.editorconfig (246 bytes)
CREATE test/.gitignore (631 bytes)
CREATE test/browserslist (429 bytes)
CREATE test/karma.conf.js (1016 bytes)
CREATE test/tsconfig.app.json (270 bytes)
CREATE test/tsconfig.spec.json (270 bytes)
CREATE test/src/favicon.ico (948 bytes)
CREATE test/src/index.html (290 bytes)
CREATE test/src/main.ts (372 bytes)
CREATE test/src/polyfills.ts (2838 bytes)
CREATE test/src/styles.scss (80 bytes)
CREATE test/src/test.ts (642 bytes)
CREATE test/src/assets/.gitkeep (0 bytes)
CREATE test/src/environments/environment.prod.ts (51 bytes)
CREATE test/src/environments/environment.ts (662 bytes)
CREATE test/src/app/app-routing.module.ts (246 bytes)
CREATE test/src/app/app.module.ts (393 bytes)
CREATE test/src/app/app.component.html (25530 bytes)
CREATE test/src/app/app.component.spec.ts (1092 bytes)
CREATE test/src/app/app.component.ts (209 bytes)
CREATE test/src/app/app.component.scss (0 bytes)
CREATE test/e2e/protractor.conf.js (810 bytes)
CREATE test/e2e/tsconfig.json (214 bytes)
CREATE test/e2e/src/app.e2e-spec.ts (637 bytes)
CREATE test/e2e/src/app.po.ts (262 bytes)
npm ERR! Unexpected end of JSON input while parsing near '...8d55f807e799df128af91'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user1\AppData\Roaming\npm-cache\_logs\2020-02-07T14_22_30_242Z-debug.log
Package install failed, see above.

2. npm install

E:\Projects\angular\others\test>npm install
npm ERR! Unexpected end of JSON input while parsing near '...eafac5a8658ca2d5d9b95'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user1\AppData\Roaming\npm-cache\_logs\2020-02-07T14_29_20_942Z-debug.log

🌍 Your Environment


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.3.9
Node: 10.16.3
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.803.9
@angular-devkit/core         8.3.9
@angular-devkit/schematics   8.3.9
@schematics/angular          8.3.9
@schematics/update           0.803.9
rxjs                         6.4.0

Anything else relevant?

ragavanrandy avatar Feb 07 '20 14:02 ragavanrandy

@ragavanrandy not really sure what's happening, but can you try using the latest CLI version please? That would be 9.0.1.

filipesilva avatar Feb 07 '20 16:02 filipesilva

This also appears to be an npm error. If this is still reproducible with the latest CLI, can you provide the contents of the npm error log file mentioned in the console?

clydin avatar Feb 07 '20 16:02 clydin

@filipesilva , i have updated to latest CLI (9.0.0). still errors are exist. 'ng new' setup projects files only and thrown error as follows:

E:\Projects\angular\others>ng new test
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS   [ https://sass-lang.com/documentation/syntax#scss
 ]
CREATE test/angular.json (3639 bytes)
CREATE test/package.json (1281 bytes)
CREATE test/README.md (1021 bytes)
CREATE test/tsconfig.json (543 bytes)
CREATE test/tslint.json (1953 bytes)
CREATE test/.editorconfig (246 bytes)
CREATE test/.gitignore (631 bytes)
CREATE test/browserslist (429 bytes)
CREATE test/karma.conf.js (1016 bytes)
CREATE test/tsconfig.app.json (210 bytes)
CREATE test/tsconfig.spec.json (270 bytes)
CREATE test/src/favicon.ico (948 bytes)
CREATE test/src/index.html (290 bytes)
CREATE test/src/main.ts (372 bytes)
CREATE test/src/polyfills.ts (2838 bytes)
CREATE test/src/styles.scss (80 bytes)
CREATE test/src/test.ts (753 bytes)
CREATE test/src/assets/.gitkeep (0 bytes)
CREATE test/src/environments/environment.prod.ts (51 bytes)
CREATE test/src/environments/environment.ts (662 bytes)
CREATE test/src/app/app-routing.module.ts (246 bytes)
CREATE test/src/app/app.module.ts (393 bytes)
CREATE test/src/app/app.component.html (25705 bytes)
CREATE test/src/app/app.component.spec.ts (1053 bytes)
CREATE test/src/app/app.component.ts (209 bytes)
CREATE test/src/app/app.component.scss (0 bytes)
CREATE test/e2e/protractor.conf.js (808 bytes)
CREATE test/e2e/tsconfig.json (214 bytes)
CREATE test/e2e/src/app.e2e-spec.ts (637 bytes)
CREATE test/e2e/src/app.po.ts (301 bytes)
\ Installing packages...npm ERR! Unexpected end of JSON input while parsing near '...BAEBCAAQBQJcgEZwCRA9T'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user1\AppData\Roaming\npm-cache\_logs\2020-02-10T06_31_20_886Z-debug.log
Γ— Package install failed, see above.

and the content of log file is,

2020-02-10T06_31_20_886Z-debug.log

doesn't add node_modules.

Then, npm install gives the following:

E:\Projects\angular\others>npm install
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! Unexpected end of JSON input while parsing near '...5","fs-extra":"^0.30.'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user1\AppData\Roaming\npm-cache\_logs\2020-02-10T07_09_42_758Z-debug.log

log file content as follows:

2020-02-10T07_09_42_758Z-debug.log

Angular CLI: 9.0.0
Node: 10.16.3
OS: win32 x64

Angular:
...
Ivy Workspace:

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.900.0
@angular-devkit/core         9.0.0
@angular-devkit/schematics   9.0.0
@schematics/angular          9.0.0
@schematics/update           0.900.0
rxjs                         6.5.3

ragavanrandy avatar Feb 10 '20 06:02 ragavanrandy

Also tried in following environment:

Angular CLI: 9.0.0
Node: 12.15.0
OS: win32 x64

Angular:
...
Ivy Workspace:

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.900.0
@angular-devkit/core         9.0.0
@angular-devkit/schematics   9.0.0
@schematics/angular          9.0.0
@schematics/update           0.900.0
rxjs                         6.5.3

Even though, i got errors as follows:

E:\Projects\angular\others>ng new test-pr
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? SCSS   [ https://sass-lang.com/documentation/syntax#scss
 ]
CREATE test-pr/angular.json (3663 bytes)
CREATE test-pr/package.json (1284 bytes)
CREATE test-pr/README.md (1023 bytes)
CREATE test-pr/tsconfig.json (543 bytes)
CREATE test-pr/tslint.json (1953 bytes)
CREATE test-pr/.editorconfig (246 bytes)
CREATE test-pr/.gitignore (631 bytes)
CREATE test-pr/browserslist (429 bytes)
CREATE test-pr/karma.conf.js (1019 bytes)
CREATE test-pr/tsconfig.app.json (210 bytes)
CREATE test-pr/tsconfig.spec.json (270 bytes)
CREATE test-pr/src/favicon.ico (948 bytes)
CREATE test-pr/src/index.html (292 bytes)
CREATE test-pr/src/main.ts (372 bytes)
CREATE test-pr/src/polyfills.ts (2838 bytes)
CREATE test-pr/src/styles.scss (80 bytes)
CREATE test-pr/src/test.ts (753 bytes)
CREATE test-pr/src/assets/.gitkeep (0 bytes)
CREATE test-pr/src/environments/environment.prod.ts (51 bytes)
CREATE test-pr/src/environments/environment.ts (662 bytes)
CREATE test-pr/src/app/app-routing.module.ts (246 bytes)
CREATE test-pr/src/app/app.module.ts (393 bytes)
CREATE test-pr/src/app/app.component.html (25705 bytes)
CREATE test-pr/src/app/app.component.spec.ts (1062 bytes)
CREATE test-pr/src/app/app.component.ts (212 bytes)
CREATE test-pr/src/app/app.component.scss (0 bytes)
CREATE test-pr/e2e/protractor.conf.js (808 bytes)
CREATE test-pr/e2e/tsconfig.json (214 bytes)
CREATE test-pr/e2e/src/app.e2e-spec.ts (640 bytes)
CREATE test-pr/e2e/src/app.po.ts (301 bytes)
| Installing packages...npm ERR! Unexpected end of JSON input while parsing near '...0"},"devDependencies"'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user1\AppData\Roaming\npm-cache\_logs\2020-02-10T11_46_31_298Z-debug.log

Γ— Package install failed, see above.
The Schematic workflow failed. See above.

the log file,

2020-02-10T11_46_31_298Z-debug.log

ragavanrandy avatar Feb 10 '20 11:02 ragavanrandy

@ragavanrandy are you using a npm proxy or something of the sort? I'm not really sure what we can do here, this is a npm error and not something we have direct control over.

You can try going into the created folder and running npm install there but I imagine the result is the same. Maybe it's a bug with your version of npm.

filipesilva avatar Feb 11 '20 11:02 filipesilva

Closing as no further information was provided.

If the problem persist please file a new issue. Thanks

alan-agius4 avatar Mar 10 '20 10:03 alan-agius4

i'm having the same problem now i have tried to reinstall npm in vein

ricoom avatar Apr 08 '20 20:04 ricoom

image

ricoom avatar Apr 08 '20 20:04 ricoom

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.