Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 9 ng new myapp gives error The Schematic workflow failed

I have angular 9 installed

Angular CLI: 9.0.1 Node: 13.8.0 OS: win32 x64

Angular: ... Ivy Workspace:

Package Version

@angular-devkit/architect 0.900.1
@angular-devkit/core 9.0.1
@angular-devkit/schematics 9.0.1
@schematics/angular 9.0.1
@schematics/update 0.900.1
rxjs 6.5.3

Everytime i try to create a new project with ng new, I'm getting the message

Installing packages...npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm ERR! Unexpected end of JSON input while parsing near '...pm-signature":"-----B' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Lijo John Daniel\AppData\Roaming\npm-cache_logs\2020-02-12T09_52_57_342Z-debug.log × Package install failed, see above. The Schematic workflow failed. See above.

I have tried re-installing angular and even node but issue still remains

My OS version is Win 10 v.1909 build 18363.592. Can someone help me with this?

like image 334
Lijo Daniel Avatar asked Feb 12 '20 10:02

Lijo Daniel


People also ask

What is latest version of angular CLI?

The Angular latest Official stable version is Angular v13. 2.5, which is released on 2nd March 2022.


16 Answers

First ,verify your NPM cached memory

npm cache verify

then try :

npm cache clean --force
npm install –g @angular/cli@latest 
ng new <YourProjectName>

If the problem persists, then try the following

npm cache clean --force
npm update
ng new <YourProjectName>
NOTE
As @0210vidit said in the comment below:

do not use dash(-) or (.) in naming

like image 147
AbolfazlR Avatar answered Sep 29 '22 12:09

AbolfazlR


Try to clean the npm cache using:

npm cache clean --force

then should it works now,

ng new my-app
like image 21
Mahrez BenHamad Avatar answered Sep 25 '22 12:09

Mahrez BenHamad


I had similar issue and installing yarn or clearing cache didn't help. I removed '-' from my app name and it worked

Error :

ng new first-app

Solved:

ng new firstapp

Hope it helps.

like image 27
0210vidit Avatar answered Sep 26 '22 12:09

0210vidit


This issue is reported for angular 9 and multiple geo-locations are facing this problem. refer https://github.com/angular/angular-cli/issues/16944

to proceed you can bring you angular version to 8 with below steps

ng --version

npm uninstall -g @angular/cli

npm cache clean --force

npm install -g @angular/[email protected]

ng --version

like image 45
smalvank Avatar answered Sep 29 '22 12:09

smalvank


I had this issue since yesterday, tried all of this and it did not work. Then I installed yarn, and configured angular cli to use yarn as the packagemanager by running this command ng config -g cli.packageManager yarn, and it worked.

like image 35
CodeNaj Avatar answered Sep 25 '22 12:09

CodeNaj


First try the following

npm cache clean --force
npm install -g @angular/cli
ng new <project-name>

If the problem persists, then try this (this eventually solved my workflow issue)

npm cache clean --force
npm update
ng new <project-name>

Thanks!

like image 37
Akhil Avatar answered Sep 29 '22 12:09

Akhil


In my case i've tried everything with npm and no way out.

But with yarn worked with no worries!

I'm a windows user but you can find how to install in other OS in yarn website!

1st - i downloaded yarn from his website yarn

2nd - installed the global package with vs terminal: yarn global add @angular/cli

3rd - still in vs terminal set: ng config -g cli.packageManager yarn

4th - i created my app: ng new myapp

5th - so you know te rest ...

Worked fine to me!

like image 26
edy matimbe Avatar answered Sep 26 '22 12:09

edy matimbe


I removed my previous solution as I somehow got hung up on the uninstalled node_modules part and presented a solution that probably wouldn't have been relevant. Here is an alternate solution that might work for you...

Open a new terminal and run node -v and then npm -v to make sure you are running compatible versions: "Node 8.9 or higher, together with NPM 5.5.1 or higher" Uninstall your current Global Angular cli npm uninstall -g @angular/cli Run npm cache verify Re-Install Angular CLI npm install -g @angular/cli@latest Close your terminal window (just because). Open a new terminal window, browse to where you want your new project and try the 'ng new` command again.

like image 44
Ibadur Rehman Avatar answered Sep 25 '22 12:09

Ibadur Rehman


This work fine top of all solutions and worked for me on Windows 10... Go to vs code new terminal type the following in order

  1. npm install --global yarn
  2. yarn global add @angular/cli
  3. ng config -g cli.packageManager yarn
  4. ng new projectname

this will fix the issue..

like image 24
Dilshan Malaka Avatar answered Sep 27 '22 12:09

Dilshan Malaka


  1. npm uninstall -g @angular/cli
  2. npm cache clean --force
  3. npm install -g @angular/cli

then should it works now,

ng new my-app
like image 31
Akitha_MJ Avatar answered Sep 28 '22 12:09

Akitha_MJ


I got it working, first I installed angular 8 then ran npm install -g @angular/cli@latest. It updated to angular 9 and now i'm able to create new projects. Thank you all for your consideration

like image 33
Lijo Daniel Avatar answered Sep 25 '22 12:09

Lijo Daniel


Angular 9 ng new myapp gives error The Schematic workflow failed......

Firstly, uninstall Angular: npm uninstall -g @angular/cli

After uninstall, you should do clean Angular cache: npm cache clean --force

After this, you should do re-install Angular globally: npm install -g @angular/cli

And check the version: ng --version

Now you can create your app: ng new your-app

like image 26
shubham khandal Avatar answered Sep 29 '22 12:09

shubham khandal


Only solution worked for me

  1. Clear NPM cache + uninstall node

  2. Install Node.js

  3. Install Angular CLI

This will cost you some Internet data, but better option than wandering around for nothing! Keep a back up of Node.js. Useful next time.

like image 39
A.K.J.94 Avatar answered Sep 27 '22 12:09

A.K.J.94


Here is the simple way, i am sure it will help because this is the error with package installation failed.

Skip node packages for now and use this command to create new app.

ng new YourAppName --skip-install

after that just go into your project directory and run npm install it will install all required packages for you.

like image 20
Saad Abbasi Avatar answered Sep 25 '22 12:09

Saad Abbasi


I struggled with this type of issue for a while.

Adding the following environment variable to your user account should solve the issue, adding a temporary cache option.

  • name: npm_config_cache
  • value: /tmp/empty-cache

More information concerning npm-config .

like image 1
Jean-Louis Avatar answered Sep 28 '22 12:09

Jean-Louis


Always update to the latest LTS version of Nodejs before using angular cli current version.

like image 1
Krishnadas PC Avatar answered Sep 29 '22 12:09

Krishnadas PC