Angular-cli: The Schematic workflow failed. See above.

Created on 12 Mar 2020  ยท  30Comments  ยท  Source: angular/angular-cli

๐Ÿž 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: 8.3.25

Description

I have ubuntu system and the configuration as follows
OS Version : Ubuntu 18.04.4 LTS
Memory : 7.5 GiB
Processor : Intelยฎ Coreโ„ข i5-6200U CPU @ 2.30GHz ร— 4
Graphics : Intelยฎ HD Graphics 520 (Skylake GT2)
GNOME : 3.28.2
OS Type : 64-bit
Disk : 983.4 GB

๐Ÿ”ฌ Minimal Reproduction


Its a fresh system

  1. Install NodeJS from ubuntu app store
  2. Select the stable version of node - v12.16.1 - stable
  3. Install 'npm i -g @angular/cli@latest'
  4. Run 'ng new my-app'
  5. The code creates the folder and stops after few mins with below error. Tried several times the issue persist.

๐Ÿ”ฅ Exception or Error


sudo ng new my-app
? 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 formbuilder-web/README.md (1031 bytes)
CREATE formbuilder-web/.editorconfig (246 bytes)
CREATE formbuilder-web/.gitignore (631 bytes)
CREATE formbuilder-web/angular.json (3727 bytes)
CREATE formbuilder-web/package.json (1292 bytes)
CREATE formbuilder-web/tsconfig.json (489 bytes)
CREATE formbuilder-web/tslint.json (1953 bytes)
CREATE formbuilder-web/browserslist (429 bytes)
CREATE formbuilder-web/karma.conf.js (1027 bytes)
CREATE formbuilder-web/tsconfig.app.json (210 bytes)
CREATE formbuilder-web/tsconfig.spec.json (270 bytes)
CREATE formbuilder-web/src/favicon.ico (948 bytes)
CREATE formbuilder-web/src/index.html (300 bytes)
CREATE formbuilder-web/src/main.ts (372 bytes)
CREATE formbuilder-web/src/polyfills.ts (2835 bytes)
CREATE formbuilder-web/src/styles.scss (80 bytes)
CREATE formbuilder-web/src/test.ts (753 bytes)
CREATE formbuilder-web/src/assets/.gitkeep (0 bytes)
CREATE formbuilder-web/src/environments/environment.prod.ts (51 bytes)
CREATE formbuilder-web/src/environments/environment.ts (662 bytes)
CREATE formbuilder-web/src/app/app-routing.module.ts (246 bytes)
CREATE formbuilder-web/src/app/app.module.ts (393 bytes)
CREATE formbuilder-web/src/app/app.component.scss (0 bytes)
CREATE formbuilder-web/src/app/app.component.html (25755 bytes)
CREATE formbuilder-web/src/app/app.component.spec.ts (1086 bytes)
CREATE formbuilder-web/src/app/app.component.ts (220 bytes)
CREATE formbuilder-web/e2e/protractor.conf.js (808 bytes)
CREATE formbuilder-web/e2e/tsconfig.json (214 bytes)
CREATE formbuilder-web/e2e/src/app.e2e-spec.ts (648 bytes)
CREATE formbuilder-web/e2e/src/app.po.ts (301 bytes)
โœ– Package install failed, see above.
The Schematic workflow failed. See above.
## ๐ŸŒ Your Environment


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / โ–ณ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 9.0.5
Node: 12.16.1
OS: linux x64

Angular: 
... 
Ivy Workspace: 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.900.5
@angular-devkit/core         9.0.5
@angular-devkit/schematics   9.0.5
@schematics/angular          9.0.5
@schematics/update           0.900.5
rxjs                         6.5.3

Anything else relevant?


Using default Terminal.

Most helpful comment

npm cache clean --force
npm i -g @angular/cli

has fixed the issue for me.

All 30 comments

I don't think this is angular-cli specific. It is being caused by the sass package. I'm running ng n test on windows which gives a verbose error:

2701 http fetch GET 304 https://registry.npmjs.org/sass 55ms (from cache) 2702 silly fetchPackageMetaData error for [email protected] Unexpected end of JSON input while parsing near '...\ncwmoW47aRoIrxuhYgKu'

I get the same error trying to install sass in an empty node project. It looks like npm has a problem with the json returned from https://registry.npmjs.org/sass. I was on npm v 6.13.4 and updated to 6.14.2 to see if it fixed the issue but that didn't help.

ncwmoW47aRoIrxuhYgKu is part of the dist.npm-signature in the json returned from https://registry.npmjs.org/sass.

npm cache clean --force
npm i -g @angular/cli

has fixed the issue for me.

Hey JayChase,

I have tried your solution but didn't helped me. I found the OS is blocking the Schematic workflow due to some permission level for my user account. Will try to reset the OS and try again as root user.

Thanks for your reply.

This issue is with the Hard Ware of my PC. Not Angular CLI issue. Thanks for the help.

hello guys, please am having same issue -- not able to install angular/cli

If the package installation failed (which is done by executing the system's node package manager: npm, yarn, etc.), then you can try to run ng new my-app --skip-install to generate the application without that step. From there you can attempt to manually run the package manager (npm install/yarn/etc.) from within the new project. For assistance with any failures at that point, please direct inquiries to the package manager's project.
npm: https://github.com/npm/cli/issues
yarn: https://github.com/yarnpkg/yarn/issues

I'm a newbie. I'm trying to create my first angular app and I got this problem too.
the error in log file: "error Unexpected end of JSON input while parsing near '...f1rUtt/W63ltUP8dva/XP'"
latest node version, latest npm version, latest angular cli version, when "ng new myapp", I choose options: add router, cscc.
I try to "npm cache clear --force", reinstall angular cli, etc, but it doesn't work. Still got the error message:
"The Schematic workflow failed. See above."
"npm ERR! Unexpected end of JSON input while parsing near '...f1rUtt/W63ltUP8dva/XP'"
Does somebody have solution ?

I also have same issue. Any fix?

CREATE bhar/e2e/src/app.po.ts (301 bytes)
| Installing packages...warning @angular-devkit/build-angular > less > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning @angular-devkit/build-angular > stylus > css-parse > css > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning @angular-devkit/build-angular > stylus > css-parse > css > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning @angular-devkit/build-angular > stylus > css-parse > css > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning @angular/cli > universal-analytics > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
warning protractor > webdriver-manager > [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
error An unexpected error occurred: "https://registry.yarnpkg.com/@angular/core/-/core-9.1.0.tgz: unexpected end of file".
ร— Package install failed, see above.
The Schematic workflow failed. See above.

i got an error like this

@csrahulram same issue here using Ubuntu SNAP distribution of node/npm (tested using channels for versions 12 and 13). Switched to debian standard apt node/npm 12 LTS distribution (via apt - https://github.com/nodesource/distributions/blob/master/README.md#debinstall) and the error has gone.

have the same issue.....any help??? I've tried all the previous solutions. i can't create a new app. I'm using Ubuntu 18.04 and node 12.16.1 and angular 9.1.1 and npm 6.14.4

I'm a newbie. I'm trying to create my first angular app and I got this problem too.
the error in log file: "error Unexpected end of JSON input while parsing near '...f1rUtt/W63ltUP8dva/XP'"
latest node version, latest npm version, latest angular cli version, when "ng new myapp", I choose options: add router, cscc.
I try to "npm cache clear --force", reinstall angular cli, etc, but it doesn't work. Still got the error message:
"The Schematic workflow failed. See above."
"npm ERR! Unexpected end of JSON input while parsing near '...f1rUtt/W63ltUP8dva/XP'"
Does somebody have solution ?

after clean uninstall node, npm, angular
rm -rf /usr/local/bin/npm /usr/local/lib/dtrace/node.d;
rm -rf ~/.npm;
rm -rf /usr/local/bin/node;
rm -rf /usr/local/lib/node_modules/npm/;
and install all again by homebrew (not use node installer), I don't get above error anymore
brew install node;
export NODE_PATH='/usr/local/lib/node_modules'
brew install angular-cli
but after that I get new error
"error Response timeout while trying to fetch"
Maybe I have some network error...but I can access the link by browser. I don't know why, but try again with some differences
I remove project and create again but skip install like these

  1. ng new angular --skip-install
  2. cd angular
  3. npm i
    everything's fine. And try
    ng serve

The angular app start successfully!

Hope these things can help :D

Have same issue Its working try it

ng new angular --skip-install
cd angular
npm i
everything's fine. And try
ng serve
The angular app start successfully!

**ng new angular --skip-install
cd angular
npm i
everything's fine. And try
ng serve
The angular app start successfully!
Thanx to everyone


same issue "The Schematic workflow failed."

I also encountered this issue. Although I initially tried with routing yes and SCSS for styles, this occurs even when choosing no for the routing prompt and CSS for styles.

Working solution

This solution involved installing and using yarn as Angular's package manager as described in a potentially related Stack Overflow post. This implies that the problem is, indeed, related to npm. Steps:

  1. Globally install yarn classic 1.22.4.
  2. Open %userprofile%\.angular-config (or equivalent file, if not on Windows).
  3. Add "packageManager": "yarn" to the "cli" object.

Resulting .angular-config file contents:

{
  "version": 1,
  "cli": {
    "analytics": false,
    "packageManager": "yarn"
  }
}

Failed solutions

  • npm cache clean --force
  • ng new my-app --skip-install followed by npm i
  • changing the codelyzer dependency from ^5.1.2 to 5.2.1 as suggested here.

Versions

I use nvm 1.1.7 to manage npm installations.

  • node -v: v12.16.1
  • npm -v: 6.13.4
  • OS: Windows 10 64-bit

ng --version:

Angular CLI: 9.1.1
Node: 12.16.1
OS: win32 x64

Angular:
...
Ivy Workspace:

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.901.1
@angular-devkit/core         9.1.1
@angular-devkit/schematics   9.1.1
@schematics/angular          9.1.1
@schematics/update           0.901.1
rxjs                         6.5.4

npm cache clean --force
npm i -g @angular/cli

has fixed the issue for me.

worked for me!
Tahnks

I use, the last versions components Angular, i had the similarity problem, i solve with increment space HD disk, "21370 error nospc ENOSPC: no space left on device, mkdir 'C:\Proyectos\angular\angular-crud\node_modules.staging\toidentifier-ff0bcd7f'" thanks everyone

npm cache clean --force
npm i -g @angular/cli

has fixed the issue for me.

Thank you this is helpful :)

devajitgupta

I'm a newbie. I'm trying to create my first angular app and I got this problem too.
the error in log file: "error Unexpected end of JSON input while parsing near '...f1rUtt/W63ltUP8dva/XP'"
latest node version, latest npm version, latest angular cli version, when "ng new myapp", I choose options: add router, cscc.
I try to "npm cache clear --force", reinstall angular cli, etc, but it doesn't work. Still got the error message:
"The Schematic workflow failed. See above."
"npm ERR! Unexpected end of JSON input while parsing near '...f1rUtt/W63ltUP8dva/XP'"
Does somebody have solution ?

after clean uninstall node, npm, angular
rm -rf /usr/local/bin/npm /usr/local/lib/dtrace/node.d;
rm -rf ~/.npm;
rm -rf /usr/local/bin/node;
rm -rf /usr/local/lib/node_modules/npm/;
and install all again by homebrew (not use node installer), I don't get above error anymore
brew install node;
export NODE_PATH='/usr/local/lib/node_modules'
brew install angular-cli
but after that I get new error
"error Response timeout while trying to fetch"
Maybe I have some network error...but I can access the link by browser. I don't know why, but try again with some differences
I remove project and create again but skip install like these

  1. ng new angular --skip-install
  2. cd angular
  3. npm i
    everything's fine. And try
    ng serve
    The angular app start successfully!

Hope these things can help :D

Does it resolve total or do i have to still go through the procedure to create new Angular App

@csrahulram same issue here using Ubuntu SNAP distribution of node/npm (tested using channels for versions 12 and 13). Switched to debian standard apt node/npm 12 LTS distribution (via apt - https://github.com/nodesource/distributions/blob/master/README.md#debinstall) and the error has gone.

I also got this issue and solved by your way. Probably because of the snap permissions issue.

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!

npm cache clean --force
npm uninstall -g @angular/cli
remove the files from %temp% and temp and prefetch and restart the system and then install the
npm install -g @angular/cli
ng new
it worked from me............

Thanks

Eventually it works.
npm cache clean --force
npm i -g @angular/cli

npm cache clean --force
npm i -g @angular/cli

corrigiu o problema para mim.

Obrigado. Essa funcionou perfeitamente pra mim.

npm cache clean --force
npm i -g @angular/cli

has fixed the issue for me.

This worked for me. But does anyone know WHY this works?

When you see npm errors similar to the following (copied from above),

Unexpected end of JSON input while parsing near '...\ncwmoW47aRoIrxuhYgKu'

it generally means npm either downloaded something incorrectly or npm's cache was somehow corrupted. By forcing the cache to be cleaned, you are emptying the cache so that a new download will occur next time the package is installed.
These errors are not Angular CLI specific and are rather related to the npm command line utility.

npm cache clean --force
npm i -g @angular/cli

has fixed the issue for me.

Its also Worked For Me..

npm cache clean --force
npm i -g @angular/cli

has fixed the issue for me.

Worked in WIndows OS

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DanielStep picture DanielStep  ยท  184Comments

ghost picture ghost  ยท  427Comments

Maistho picture Maistho  ยท  140Comments

burdzand picture burdzand  ยท  100Comments

ankeshdave picture ankeshdave  ยท  161Comments