Skip to content

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

Closed

Description

@ribizli

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.

Activity

  1. filipesilva commented on Sep 9, 2016

    @filipesilva
    Contributor

    node@5.12.0, npm@3.8.6, 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.

  2. filipesilva commented on Sep 10, 2016

    @filipesilva
    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:

    • 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 angular-cli@1.0.0-beta.11-webpack.8
    • 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: electron-userland/electron-prebuilt#63 (comment)

    As reported by @rbj325, using node@6.5.0 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

  3. filipesilva commented on Sep 12, 2016

    @filipesilva
    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.

  4. removed
    P0Issue that causes an outage, breakage, or major function to be unusable, with no known workarounds
    on Sep 12, 2016
  5. SparK-Cruz commented on Sep 14, 2016

    @SparK-Cruz

    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

  6. krishollenbeck commented on Sep 14, 2016

    @krishollenbeck

    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'
    
  7. byteofsilicon commented on Sep 19, 2016

    @byteofsilicon

    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

  8. web-dave commented on Sep 21, 2016

    @web-dave

    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.

  9. sryzycki commented on Sep 26, 2016

    @sryzycki

    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

  10. filipesilva commented on Dec 22, 2016

    @filipesilva
    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.

  11. ultramarichka commented on Oct 30, 2017

    @ultramarichka

    nvm install 6.11.3

    helped me to install that damn package

  12. alperdemirci commented on Nov 1, 2017

    @alperdemirci

    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

  13. sushilcmd commented on Feb 5, 2018

    @sushilcmd

    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

  14. thinkspill commented on Feb 12, 2018

    @thinkspill

    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
    
  15. trainoasis commented on Mar 20, 2018

    @trainoasis

    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
    
  16. bungmomomm commented on Mar 29, 2018

    @bungmomomm

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

  17. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  18. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions