angular-cli: Error: Cannot find module 'process-nextick-args'

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Windows 10
  2. Versions. Please run ng --version. If there’s nothing outputted, please run in a Terminal: node --version and paste the result here: I cannot even get this (same error). But installed 1.0.0-beta.11-webpack.8
  3. Repro steps. Was this an app that wasn’t created using the CLI? What change did you do on your code? etc.
  4. The log given by the failure. Normally this include a stack trace and some more information.
Error while running script "C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\addon\ng2\tasks\serve-webpack.ts":
Error: Cannot find module 'process-nextick-args'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Function.Module._load (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\readable-stream\lib\_stream_readable.js:6:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module._load (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\readable-stream\readable.js:6:28)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module._load (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:468:17)
Error while running script "C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\addon\ng2\commands\serve.ts":
Error: Cannot find module 'process-nextick-args'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Function.Module._load (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\readable-stream\lib\_stream_readable.js:6:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module._load (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\readable-stream\readable.js:6:28)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module._load (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:468:17)
Cannot find module 'process-nextick-args'
Error: Cannot find module 'process-nextick-args'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Function.Module._load (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\readable-stream\lib\_stream_readable.js:6:23)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module._load (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\readable-stream\readable.js:6:28)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module._load (C:\work\PST\workspace\PST\pst-app-client\cli2\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:468:17)
  1. Mention any other details that might be useful.

Tried to init a project (ng init). Installed locally in the project’s directory (npm i angular-cli@webpack)


Thanks! We’ll be in touch soon.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 13
  • Comments: 27 (7 by maintainers)

Most upvoted comments

I solved it. I install some modules manually.

npm i process-nextick-args util-deprecate

I am getting this error too after a fresh install of angular-cli@webpack and then running any ng command.

I have used the above trick, but had to globally.

npm i -g process-nextick-args util-deprecate

Update npm to version 3.x.x

have you tried my solution before downvoting? that’s how I fixed it. You don’t need to bloat-up you global packages. 😉

Just playing around - I updated process-nextick-args, that is a dependency of readable stream from 1.0.6 to 1.0.7 and this fixed the issue for me.

Upgrading Node.js to 6.5 and reinstalling angular-cli also fixes this.

I’m also getting this same issue (on a mac) after updating to the angular-cli webpack version following the steps here:

https://github.com/angular/angular-cli/blob/master/WEBPACK_UPDATE.md

  1. Mac - El Capitan version 10.11.5
  2. Same as above, running ng --version causes the same error, node version is: v5.4.0
  3. Just running: ng new test
  4. Same stack trace as above.

Thanks

Seeing this error directly after npm i -g npm. Now even npm -v returns the process-nextick-args not found errror.

Node/npm originally installed via nodesource.com.

$ nodejs --version
v6.12.3

$ npm -v
module.js:471
    throw err;
    ^

Error: Cannot find module 'process-nextick-args'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:26:23)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

Distributor ID: Debian
Description:    Debian GNU/Linux 8.10 (jessie)
Release:        8.10
Codename:       jessie

Linux b8022312ce29 4.9.75-linuxkit-aufs #1 SMP Tue Jan 9 10:58:17 UTC 2018 x86_64 GNU/Linux

@sculove yes, this solution works for me too, but this seems to be a bug in the dependency hierarchy of angular-cli.