Skip to content

Cannot find module 'exists-sync' #1186

Closed

Description

@cre8
  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    os: Windows 10

  2. Versions. Please run ng --version. If there's nothing outputted, please
    angular-cli: 1.0.0-beta.8
    node: 6.2.2
    os: win32 x64

  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    I updated to the latest cli version (beta 8). When I run ng outside the project it shows me all the options. But when I run it inside my project I get an error.

  4. The log given by the failure. Normally this include a stack trace and some
    more information.
    Error: Cannot find module 'exists-sync'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object. (C:\xampp\htdocs\foo1\node_modules\angular-cli\node_modules\ember-cli\lib\models\project.js:11:26)
    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)

  5. Mention any other details that might be useful.


    Thanks! We'll be in touch soon.

Activity

  1. elliott-davis commented on Jun 23, 2016

    @elliott-davis

    I hit this too and got around it by running a npm install

  2. scrivy commented on Jun 23, 2016

    @scrivy

    I still get the same error after running npm install :-/

    ng init
    module.js:327
    throw err;
    ^

    Error: Cannot find module 'exists-sync'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object. (/srv/fuma/frontend/node_modules/angular-cli/node_modules/ember-cli/lib/models/project.js:11:26)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

    Mac OS X El Capitan 10.11.5
    angular-cli: 1.0.0-beta.8
    node v4.4.5
    npm 2.15.4

  3. Rafi993 commented on Jun 24, 2016

    @Rafi993

    I did npm install in the nodemodules and it generated new project but when I typed
    ng serve --port 4201 --live-reload-port 49153 It shows the same error again

    module.js:327
        throw err;
        ^
    
    Error: Cannot find module 'exists-sync'
        at Function.Module._resolveFilename (module.js:325:15)
        at Function.Module._load (module.js:276:25)
        at Module.require (module.js:353:17)
        at require (internal/module.js:12:17)
        at Object.<anonymous> (C:\Users\Desktop\ngTest\node_modules\angular-cli\node_modules\ember-cli\lib\models\project.js:11:26)
        at Module._compile (module.js:409:26)
        at Object.Module._extensions..js (module.js:416:10)
        at Module.load (module.js:343:32)
        at Function.Module._load (module.js:300:12)
        at Module.require (module.js:353:17)
    
    
  4. tieppt commented on Jun 24, 2016

    @tieppt

    go to angular-cli installed directory ex: C:\xampp\htdocs\foo1\node_modules\angular-cli run npm i

  5. crzyjcky commented on Jun 24, 2016

    @crzyjcky

    I ran "npm install" twice:

    1. For "ng new" to work:
      cd /usr/lib/node_modules/angular-cli
      sudo npm install
    2. For "ng serve" to work:
      cd "your project folder"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/node_modules/angular-cli
      npm install
  6. littleStudent commented on Jun 24, 2016

    @littleStudent

    just had the same problem on macOS
    running npm install did solve it.

  7. KarlPurk commented on Jun 24, 2016

    @KarlPurk

    Just hit this problem too. Should the readme be updated to mention npm install as this doesn't instil confidence for newcomers? The first thing the readme shows is:

    ng new PROJECT_NAME
    cd PROJECT_NAME
    ng serve
    

    and that doesn't work due to this issue.

  8. Codermar commented on Jun 24, 2016

    @Codermar

    Re-installing the CLI (to beta8) and starting a brand new project, I had to do additional npm installs before I was able to run the app.

    npm i -D exists-sync
    npm i -D object-assign
    npm i -D minimatch
    npm i -D walk-sync
    npm i -D through

  9. M4RTO commented on Jun 24, 2016

    @M4RTO

    you have to go inside the directory of angular cli , inside of node and npm install

  10. Codermar commented on Jun 24, 2016

    @Codermar

    That's right, I had to do that too but still had to do the additional installs after ng new in the project itself.

  11. M4RTO commented on Jun 24, 2016

    @M4RTO

    Error: Cannot find module 'exists-sync'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object. (C:\Users\Martin\Documents\project\newProject\project\node_modules\angular-cli\node_modules\ember-cli\lib\models\project.js:11:26)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

    algo asi ?

    en esta carpeta dale npm install y fue .. , en la tuya en tu caso
    \Users\Martin\Documents\project\newProject\project\node_modules\angular-cli\node_modules

  12. rijine commented on Jun 24, 2016

    @rijine

    got same problem, npm install --save works for me

  13. david-lee commented on Jun 25, 2016

    @david-lee

    ran npm install and worked for me

  14. EdwinFernandoGarciaLozano commented on Jun 25, 2016

    @EdwinFernandoGarciaLozano

    npm install and worked for me
    Thanks!

  15. 27 remaining items

  16. tieppt commented on Jul 4, 2016

    @tieppt

    @rbnzdave scroll up, then install dev dependencies for angular-cli 🆙

  17. msiddiqi commented on Jul 4, 2016

    @msiddiqi

    Just do npm install in your project. That fixed it for me.

  18. rbnzdave commented on Jul 4, 2016

    @rbnzdave

    @tieppt yeah was going to do that today, was just pointing out that a fresh install of everything wasn't working either so wasnt just "update npm" :)

  19. rbnzdave commented on Jul 4, 2016

    @rbnzdave

    using npm i -D [items] didnt work for me, i had to

    npm install -g exists-sync
    npm install -g object-assign
    npm install -g minimatch
    npm install -g walk-sync
    npm install -g through
    

    and now npm new reddit-clone is actually doing something for me. (following r33 tutorial mp4 from ng-book2. totally recommend)

    --update : and now ng serve is failing from not being able to find 'exists-sync' think i've got bigger problems somewhere.

    --update 2 : apparently a fresh install of node.js doesnt include an updated npm. ran

    npm install -g npm
    

    and then ng serve works fine. I'm almost ready to wipe out nodejs/npm completely and re-install just to see if that was the issue the whole time. if you are having issues, like me, and

    npm -v 
    

    doesnt get you at least 3.x.x etc, you will need to manually install npm to get the latest version.

  20. samirthebti commented on Jul 5, 2016

    @samirthebti

    Hi all :
    This problem is seriously blocker any help !!

  21. mchamo commented on Aug 12, 2016

    @mchamo

    @ddagone is there a dependency on node 6.2.2? I may have missed it, but, I don't see that stated on angular cli website or this git repo?

  22. ctrl-brk commented on Jun 8, 2017

    @ctrl-brk

    Upgraded to the latest npm 5.0.3 and had
    angular cli cannot find module 'rsvp'
    Going to node_modules/angular/cli and running nmp i fixed it but...

  23. BenRacicot commented on Jun 17, 2017

    @BenRacicot

    I can confirm the issue from @ctrl-brk however I cannot get it to work by npm i the cli #showstopper

  24. phillipzada commented on Jul 12, 2017

    @phillipzada

    The following worked for me.

    npm cache clean --force
    cd node_modules\@angular\cli
    npm i
    cd ..\..\..
    npm i
    ng serve
    
  25. angular-automatic-lock-bot commented on Sep 7, 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.

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

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfultype: bug/fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions