Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ribizli opened this issue Sep 1, 2016 · 27 comments
Closed

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

ribizli opened this issue Sep 1, 2016 · 27 comments
Assignees

Comments

@ribizli
Copy link

ribizli commented Sep 1, 2016

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.

@giuseppepaul
Copy link

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
Copy link

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.

@monojack
Copy link
Contributor

monojack commented Sep 1, 2016

Update npm to version 3.x.x

@sculove
Copy link

sculove commented Sep 2, 2016

I solved it.
I install some modules manually.

npm i process-nextick-args util-deprecate

@bthharper
Copy link

bthharper commented Sep 2, 2016

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

@ribizli
Copy link
Author

ribizli commented Sep 2, 2016

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

@monojack
Copy link
Contributor

monojack commented Sep 2, 2016

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

@bthharper
Copy link

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.

@mdocter
Copy link

mdocter commented Sep 6, 2016

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 :-).

@rbj325
Copy link

rbj325 commented Sep 8, 2016

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

@filipesilva filipesilva added os: Windows P0 Issue that causes an outage, breakage, or major function to be unusable, with no known workarounds labels Sep 9, 2016
@filipesilva
Copy link
Contributor

Looking into it myself.

@filipesilva
Copy link
Contributor

filipesilva commented Sep 9, 2016

[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
Copy link
Contributor

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:

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: electron-userland/electron-prebuilt#63 (comment)

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
Copy link
Contributor

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 filipesilva removed feature: webpack P0 Issue that causes an outage, breakage, or major function to be unusable, with no known workarounds labels Sep 12, 2016
@SparK-Cruz
Copy link

SparK-Cruz commented Sep 14, 2016

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

@krishollenbeck
Copy link

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'

@byteofsilicon
Copy link

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

@web-dave
Copy link

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.

@sryzycki
Copy link

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

@filipesilva
Copy link
Contributor

I think this was completely fixed in #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.

@ultramarichka
Copy link

nvm install 6.11.3

helped me to install that damn package

@alperdemirci
Copy link

I ran into this issue and after spending sometime, I decided to delete node and npm.

To completely uninstall node + npm is to do the following:

  1. go to /usr/local/lib and delete any node and node_modules
  2. go to /usr/local/include and delete any node and node_modules directory
  3. if you installed with brew install node, then run brew uninstall node in your terminal
  4. check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
  5. go to /usr/local/bin and delete any node executable
    I find all this from this link https://stackoverflow.com/a/11178106

And if you don't know how to reinstall Node and npm, follow this: http://blog.teamtreehouse.com/install-node-js-npm-mac

I hope this will help everyone

@sushilcmd
Copy link

I think this issue occur because of node version .So update your node and npm version.
I had same issue on Ubuntu then i updated my node and npm version and install angular CLI :)

Check node version

nodejs --version

Update node version

sudo apt-get install nodejs

Update npm version

sudo apt-get install npm

Install angular CLI

npm install -g @angular/cli

@thinkspill
Copy link

thinkspill commented Feb 12, 2018

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

@trainoasis
Copy link

trainoasis commented Mar 20, 2018

Same problem as @thinkspill. npm -v throws the error already. Can't use any of the solutions above, since each time the same error pops up. Any ideas perhaps? 😞

~ node -v
v9.8.0

@bungmomomm
Copy link

In my case it happens when i install yarn and seems there are conflict happens in there

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests