Cli: Ng new project isn't working

Created on 22 Apr 2020  ·  45Comments  ·  Source: npm/cli

i am trying to create a new angular project , it's not working and having this output :
i have node v : v13.13.0
angular v : Angular CLI: 9.1.2
npm v : '6.14.4'

\ Installing packages...npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+. Upgrade to fsevents 2 with massive improvements.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...},"4.2.1":{"name":"@a'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dell\AppData\Roaming\npm-cache_logs\2020-04-22T08_41_24_031Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.

Release 6.x

Most helpful comment

I had the exact same error and was able to fix it through following steps.

  1. Run npm cache clean --force
  2. Manually delete npm and npm-cache folders from AppData/Roaming folder (Win + R, Type %AppData% and enter)
  3. Run Node Installer and repair
  4. Reinstall npm install -g @angular/cli
  5. Rerun ng new newApp
    Worked :)

All 45 comments

Having the same error here:
CREATE goty/e2e/src/app.po.ts (301 bytes)
\ Installing packages...npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Andres\AppData\Roaming\npm-cache_logs\2020-04-22T20_44_15_910Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.

And the log states as following in the last lines:

1726 http fetch GET 200 https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz 45ms
1727 silly pacote range manifest for p-locate@^3.0.0 fetched in 10221ms
1728 silly pacote range manifest for p-limit@^2.0.0 fetched in 2ms
1729 timing npm Completed in 183765ms
1730 error cb() never called!
1731 error This is an error with npm itself. Please report this error at:
1732 error https://npm.community

install latest angular cli by:
npm install -g @angular/cli@latest

Hi all,
Same issue with 9.1.3

same issue.. can anyone pls suggest solution?

same problem when creating new angular project ..
node -v : v12.16.2
npm -v : 6.14.4
Angular CLI: 9.1.3
i have tried everything that i found in the internet , but nothing worked ,, what can i do ?!!

Hii.. I worked around it (after lots of debugging), guess the problem is with npm cli.

I uninstalled the latest node and npm versions, and went back to node v12.4.0 and npm 6.9.0

For now everything works! (using angular/cli 9.1.3)

try it.

https://github.com/npm/cli/issues/1191#issuecomment-619064170
vijay-flexiloans .. this worked for me , thanks

how can I get node v12.4.0 and npm 6.9.0 ?
Because I am facing the same error

https://tecadmin.net/upgrade-nodejs-via-npm/

i change sudo n stable to:
sudo n 12.4.0
after that:
node -v => 12.4.0
npm -v => 6.9.0

those worked for me

npm install -g @angular/cli
npm install mkdirp
npm cache verify

close the terminal and open it again
ng new newApp

it will work for this issue......

how can I get node v12.4.0 and npm 6.9.0 ?
Because I am facing the same error

npm install -g @angular/cli
npm install mkdirp
npm cache verify

close the terminal and open it again
ng new newApp

it will work for this issue......

i am trying to create a new angular project , it's not working and having this output :
i have node v : v13.13.0
angular v : Angular CLI: 9.1.2
npm v : '6.14.4'

\ Installing packages...npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see palantir/tslint#4534 for more information.
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+. Upgrade to fsevents 2 with massive improvements.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected end of JSON input while parsing near '...},"4.2.1":{"name":"@A'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\dell\AppData\Roaming\npm-cache_logs\2020-04-22T08_41_24_031Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.

npm install -g @angular/cli
npm install mkdirp
npm cache verify

close the terminal and open it again
ng new newApp

it will work for this issue......
try it

npm install -g @angular/cli
npm install mkdirp
npm cache verify

close the terminal and open it again
ng new newApp

it will work for this issue......
try it

This does not fix the issue. There is no change after running these steps

Edit: my issue is slightly different but gives the same error message of "schematic workflow failed"

My issue seems to be a permissions error un-linking from the .staging directory.

npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path c:\src\play\monorepo\node_modules\.staging\@angular\core-94532156\fesm2015\core.js.map
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'c:\src\play\monorepo\node_modules\.staging\@angular\core-94532156\fesm2015\core.js.map'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink 'c:\src\play\monorepo\node_modules\.staging\@angular\core-94532156\fesm2015\core.js.map'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, unlink 'c:\src\play\monorepo\node_modules\.staging\@angular\core-94532156\fesm2015\core.js.map'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'unlink',
npm ERR!     path: 'c:\\src\\play\\monorepo\\node_modules\\.staging\\@angular\\core-94532156\\fesm2015\\core.js.map'
npm ERR!   },
npm ERR!   stack: "Error: EPERM: operation not permitted, unlink 'c:\\src\\play\\monorepo\\node_modules\\.staging\\@angular\\core-94532156\\fesm2015\\core.js.map'",
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'c:\\src\\play\\monorepo\\node_modules\\.staging\\@angular\\core-94532156\\fesm2015\\core.js.map',
npm ERR!   parent: 'monorepo'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\john.stillwell\AppData\Roaming\npm-cache\_logs\2020-05-04T14_36_04_180Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.

how can I get node v12.4.0 and npm 6.9.0 ?
Because I am facing the same error

npm install -g @angular/cli
npm install mkdirp
npm cache verify

close the terminal and open it again
ng new newApp

it will work for this issue......

not working

Installing packages...npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\rollup\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})

npm ERR! Unexpected end of JSON input while parsing near '...hj3+GWoYF1z+Vc+WQ1hiz'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sony\AppData\Roaming\npm-cache_logs\2020-05-11T14_57_02_945Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above
suggest me anyone

I had the exact same error and was able to fix it through following steps.

  1. Run npm cache clean --force
  2. Manually delete npm and npm-cache folders from AppData/Roaming folder (Win + R, Type %AppData% and enter)
  3. Run Node Installer and repair
  4. Reinstall npm install -g @angular/cli
  5. Rerun ng new newApp
    Worked :)

didnt worked for me @vipmat

didnt worked for me also

None of the above worked at all.

None of the above solutions worked

I had the exact same error and was able to fix it through following steps.

  1. Run npm cache clean --force
  2. Manually delete npm and npm-cache folders from AppData/Roaming folder (Win + R, Type %AppData% and enter)
  3. Run Node Installer and repair
  4. Reinstall npm install -g @angular/cli
  5. Rerun ng new newApp
    Worked :)

Use node V12.4.0 and npm *V6.9.0*

I had been facing the same issue.
Try with following steps:

  1. clear your npm cache.
  2. reinstall Angular CLI
  3. create a new app

Commands:
npm cache clean --force
npm install -g @angular/cli@latest
ng new appname

This is working for me.

I had the exact same error and was able to fix it through following steps.

  1. Run npm cache clean --force
  2. Manually delete npm and npm-cache folders from AppData/Roaming folder (Win + R, Type %AppData% and enter)
  3. Run Node Installer and repair
  4. Reinstall npm install -g @angular/cli
  5. Rerun ng new newApp
    Worked :)

This worked for me , with Node v12.16.1 and NPM 6.13.4
Try to close the CMD window for (no particular reason) after step 4.

Tried to do everything suggested still could not get the result. Is this issue in Windows machine only.

Tried to do everything suggested still could not get the result. Is this issue in Windows machine only.

no macOS also has same issue

npm install mkdirp

not working

my issue solved after i update Node and NPM to latest version

I had been facing the same issue.
Try with following steps:

  1. clear your npm cache.
  2. reinstall Angular CLI
  3. create a new app

Commands:
npm cache clean --force
npm install -g @angular/cli@latest
ng new appname

This is working for me.

worked

I had the exact same error and was able to fix it through following steps.

  1. Run npm cache clean --force
  2. Manually delete npm and npm-cache folders from AppData/Roaming folder (Win + R, Type %AppData% and enter)
  3. Run Node Installer and repair
  4. Reinstall npm install -g @angular/cli
  5. Rerun ng new newApp
    Worked :)

worked for me

Looks like solutions above worked for Windows .. Please anyone with solution for MacOs. I'm having this exact same problem. I have followed the above steps
npm cache clean --force
Reinstall Node
npm install -g @angular/cli
ng new newApp

This doesn't work for MacOs
⠋ Installing packages...npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! code EINTEGRITY
npm ERR! sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== integrity checksum failed when using sha512: wanted sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== but got sha512-SDNbdBTRZ2fssGLLtyrIoN+V9gJke5XIAQboHY6m9QiOEGOodbMwDtQxoxeS8EmkdlhAZm9kV9deY0opak43mw==. (5634503 bytes)

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/adams.mayowa/.npm/_logs/2020-06-21T17_22_47_139Z-debug.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.

I had been facing the same issue.
Try with following steps:

  1. clear your npm cache.
  2. reinstall Angular CLI
  3. create a new app

Commands:
npm cache clean --force
npm install -g @angular/cli@latest
ng new appname

This is working for me.

THIS ONE IS ASLO WORKED FOR ME.
THANKS A LOT

Looks like solutions above worked for Windows .. Please anyone with solution for MacOs. I'm having this exact same problem. I have followed the above steps
npm cache clean --force
Reinstall Node
npm install -g @angular/cli
ng new newApp

This doesn't work for MacOs
⠋ Installing packages...npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see palantir/tslint#4534 for more information.
npm WARN deprecated [email protected]: request has been deprecated, see request/request#3142
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! code EINTEGRITY
npm ERR! sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== integrity checksum failed when using sha512: wanted sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== but got sha512-SDNbdBTRZ2fssGLLtyrIoN+V9gJke5XIAQboHY6m9QiOEGOodbMwDtQxoxeS8EmkdlhAZm9kV9deY0opak43mw==. (5634503 bytes)

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/adams.mayowa/.npm/_logs/2020-06-21T17_22_47_139Z-debug.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.

For MACBOOK, i updated angular, Node and NPM version to latest version

I had been facing the same issue.
Try with following steps:

  1. clear your npm cache.
  2. reinstall Angular CLI
  3. create a new app

Commands:
npm cache clean --force
npm install -g @angular/cli@latest
ng new appname
This is working for me.

THIS ONE IS ASLO WORKED FOR ME.
THANKS A LOT

Thank you, all fixed now. restarting the PC after upgrade of Node, npm cache clean, reinstall Angular CLI worked for me

I had been facing the same issue.
Try with following steps:

  1. clear your npm cache.
  2. reinstall Angular CLI
  3. create a new app

Commands:
npm cache clean --force
npm install -g @angular/cli@latest
ng new appname

This is working for me.

This worked for me
Thank you

npm cache clean --force

this command work for me.

npm cache clean --force

Same here. This command work for me. I just happened to get into this problem today after I reinstall my npm and my node at v14+. After the npm cache clean the version become the older version and I managed to run the ng new command.

I faced the same issue , but got resolved with this:-

npm cache clear --force

may the issue was because of the error
npm ERR! Unexpected end of JSON input while parsing near '...},"4.2.1":{"name":"@A'

https://tecadmin.net/upgrade-nodejs-via-npm/

i change sudo n stable to:
sudo n 12.4.0
after that:
node -v => 12.4.0
npm -v => 6.9.0

those worked for me

This solved the problem for me. my node version was 10 and I needed to upgrade it to version 12.

I tried every recommendation.
Nothing works. I gave up with Angular.
Two days later, it, magically, works.

WTF

Clearing Nmp cache worked

npm cache clear --force

Hii.. I worked around it (after lots of debugging), guess the problem is with npm cli.

I uninstalled the latest node and npm versions, and went back to node v12.4.0 and npm 6.9.0

For now everything works! (using angular/cli 9.1.3)

try it.

how to upgrade?? which commands did u use?

Installing packages...npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN registry Unexpected warning for https://infyartifactory.ad.infosys.com/artifactory/api/npm/npm: Miscellaneous Warning ECONNRESET: request to https://infyartifactory.ad.infosys.com/artifactory/api/npm/npm/slash failed, reason: socket hang up
npm WARN registry Using stale data from https://infyartifactory.ad.infosys.com/artifactory/api/npm/npm due to a request error during revalidation.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\shiwangi02\AppData\Roaming\npm-cache_logs\2020-10-11T07_07_59_289Z-debug.log
× Package install failed, see above.
The Schematic workflow failed. See above.

i'm getting this error from yesterday, unable to resolve plz help.

how can I get node v12.4.0 and npm 6.9.0 ?
Because I am facing the same error

yeah same, if you get plz tell me also

i am still having this problem tried everything
npm version :- 6.14.8
noed version :- 14.13.1
Angular CLI: 10.1.6

Closing: we don't support project-specific support/debugging but it looks like @Vipmat & @shiva-github both provided fairly good paths to resolving this issue for most folks (ref. https://github.com/npm/cli/issues/1191#issuecomment-627238482 & https://github.com/npm/cli/issues/1191#issuecomment-637286144 respectively)

If you have problems in the future w/ the Angular CLI, please file an issue over on their repo: https://github.com/angular/angular-cli

If you think you've found a problem with npm itself, please check to see if a bug has already been created in our backlog - for a similar problem - before using one of our templates to file the issue: https://github.com/npm/cli/issues/new/choose

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CliffS picture CliffS  ·  3Comments

ahuglajbclajep picture ahuglajbclajep  ·  3Comments

MadhuriGurumurthy11 picture MadhuriGurumurthy11  ·  3Comments

DullReferenceException picture DullReferenceException  ·  4Comments

billop picture billop  ·  3Comments