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

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

Open ribizli opened this issue 10 years ago • 27 comments

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.

ribizli avatar Sep 01 '16 08:09 ribizli

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

giuseppepaul avatar Sep 01 '16 11:09 giuseppepaul

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.

giuseppepaul avatar Sep 01 '16 11:09 giuseppepaul

Update npm to version 3.x.x

monojack avatar Sep 01 '16 22:09 monojack

I solved it. I install some modules manually.

npm i process-nextick-args util-deprecate

sculove avatar Sep 02 '16 10:09 sculove

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

bthharper avatar Sep 02 '16 11:09 bthharper

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

ribizli avatar Sep 02 '16 12:09 ribizli

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

monojack avatar Sep 02 '16 14:09 monojack

I'd already checked my version of npm, and was already running a variant of version 3. Did check though. The workaround proposed by @sculove (with a slight modification to do it globally) worked for me, but as @ribizli states this is a bug in the dependencies which has crept in somewhere.

bthharper avatar Sep 02 '16 15:09 bthharper

Even ng --version threw this error. Globally installing the process-nextick-args and util-deprecate packages didn't fix it for me. I'm running on Windows 10 (x64), so I had to cd into /c/Program Files/nodejs/node_modules/angular-cli and npm install both packages there locally, so without the -g flag :-).

mdocter avatar Sep 06 '16 10:09 mdocter

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

rbj325 avatar Sep 08 '16 20:09 rbj325

Looking into it myself.

filipesilva avatar Sep 09 '16 02:09 filipesilva

[email protected], [email protected], win10.

Tried making a custom version and installing globally from it.

I can verify that adding process-nextick-args util-deprecate to the depedencies fixes this issue, but can't help but think this a symptom of another problem. Will investigate more.

Edit: Can also verify that it doesn't have anything to do with our devDependencies, as I copied them over into dependencies and got the same error.

On a fresh copy of the repo, npm install seems to fail initially with a node-sass related problem, but a second npm install works fine. npm link after that doesn't give any errors on ng version. This might be related with some custom logic we have for npm linked setups.

filipesilva avatar Sep 09 '16 03:09 filipesilva

I've been trying to get to the root of this issue without much success. As far as I can tell, this is either a node or a nvm problem somehow. Maybe an odd combination of packages, or some kind of odd interaction with packages that try to be built like node-sass.

I've tried a lot of installs so far, and the best way I've found to reproduce this in Windows:

  • install https://github.com/creationix/nvm
  • nvm install 5.12.0 (if you have it already, uninstall and reinstall)
  • nvm use 5.12.0
  • npm install -g [email protected]
  • ng version

This gets me the error shown in the initial report:

$ ng version
Error while running script "C:\Users\kamik\AppData\Roaming\nvm\v5.12.0\node_modules\angular-cli\addon\ng2\tasks\serve-webpack.ts":
Error: Cannot find module 'process-nextick-args'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Function.Module._load (C:\Users\kamik\AppData\Roaming\nvm\v5.12.0\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\kamik\AppData\Roaming\nvm\v5.12.0\node_modules\angular-cli\node_modules\readable-stream\lib\_stream_readable.js:6:23)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module._load (C:\Users\kamik\AppData\Roaming\nvm\v5.12.0\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\kamik\AppData\Roaming\nvm\v5.12.0\node_modules\angular-cli\node_modules\readable-stream\readable.js:6:28)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module._load (C:\Users\kamik\AppData\Roaming\nvm\v5.12.0\node_modules\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\kamik\AppData\Roaming\nvm\v5.12.0\node_modules\angular-cli\node_modules\memory-fs\lib\MemoryFileSystem.js:8:14)
(...)

As reported by @kevinsawicki, this also seems to happen in other projects: https://github.com/electron-userland/electron-prebuilt/issues/63#issuecomment-246029913

As reported by @rbj325, using [email protected] seems to work. This is best user solution I've found so far.

I'm not sure what can be done on our side to support node 5... we could add process-nextick-args util-deprecate as dependencies, but we don't even use them directly.

/cc @hansl

filipesilva avatar Sep 10 '16 02:09 filipesilva

Removing the critical label as it only seems to affect a subset of users and, as far as I can tell, it's not within out control to fix it.

filipesilva avatar Sep 12 '16 03:09 filipesilva

I'm on linux, node 6.2.0 (via distro's package manager), same error. Installing both dependencies as global packages fixed for me.

# npm install -g angular-cli@webpack ... warnings, native builds failing, messedup makefiles... $ ng init error

#arrumaIssoFilipe

SparK-Cruz avatar Sep 14 '16 07:09 SparK-Cruz

I am also getting this error after attempting to update from "angular-cli": "1.0.0-beta.11-webpack", to "angular-cli": "1.0.0-beta.11-webpack.3".

Windows 7 Node 6.2.1 NPM 3.9.3

\angular-cli\lib\bootstrap-local.js:55:22)
    at Module.require (module.js:468:17)
Cannot find module 'process-nextick-args'

krishollenbeck avatar Sep 14 '16 15:09 krishollenbeck

I am receiving this error as well. I installed the latest version of the CLI globablly: npm uninstall -g angular-cli npm cache clean npm install -g angular-cli@latest then created new angular2 project using the ng new project command to create a new project then executing the ng serve command.

Operating System: Windows 7 Angular CLI version: 1.0.0-beta.14 Node version: 6.5.0 NPM version: 3.9.2

byteofsilicon avatar Sep 19 '16 12:09 byteofsilicon

Still exists at beta 15. angular-cli: 1.0.0-beta.15 node: 4.5.0 os: win32 ia32

npm i process-nextick-args util-deprecate fixed it.

web-dave avatar Sep 21 '16 07:09 web-dave

I can confirm that ng command works for this setup as listed below (after upgrading Node):

angular-cli: 1.0.0-beta.15 node: 6.6.0 os: darwin x64

sryzycki avatar Sep 26 '16 22:09 sryzycki

I think this was completely fixed in https://github.com/angular/angular-cli/pull/3414. My theory is that, on machines that could build node-zopfli, it could fail and leave you with an incomplete install.

Closing but please let me know if it still happens.

filipesilva avatar Dec 22 '16 18:12 filipesilva