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

Cannot find module 'exists-sync' #1186

Closed
cre8 opened this issue Jun 23, 2016 · 48 comments · Fixed by #1250
Closed

Cannot find module 'exists-sync' #1186

cre8 opened this issue Jun 23, 2016 · 48 comments · Fixed by #1250
Assignees
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix

Comments

@cre8
Copy link

cre8 commented Jun 23, 2016

  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.

@elliott-davis
Copy link

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

@scrivy
Copy link

scrivy commented Jun 23, 2016

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

@Rafi993
Copy link

Rafi993 commented Jun 24, 2016

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)

@tieppt
Copy link

tieppt commented Jun 24, 2016

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

@crzyjcky
Copy link

crzyjcky commented Jun 24, 2016

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"/node_modules/angular-cli
    npm install

@littleStudent
Copy link

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

@KarlPurk
Copy link

KarlPurk commented Jun 24, 2016

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.

@ghost
Copy link

ghost commented Jun 24, 2016

try running npm install exists-sync --save-dev in the project folder.

@Codermar
Copy link

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

@M4RTO
Copy link

M4RTO commented Jun 24, 2016

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

@Codermar
Copy link

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

@M4RTO
Copy link

M4RTO commented Jun 24, 2016

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

@rijine
Copy link

rijine commented Jun 24, 2016

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

@david-lee
Copy link

ran npm install and worked for me

@EdwinFernandoGarciaLozano

npm install and worked for me
Thanks!

d-koppenhagen referenced this issue in angular-buch/book-monkey2 Jun 26, 2016
- Navigation problem was solved by new version of @angular/router (alpha.8)
- adds some packages to devDependencies because of some angular-cli problems
  - see: https://github.com/angular/angular-cli/issues/1186\#issuecomment-228364667
@fmalcher @GregOnNet @JohannesHoppe
@jprinaldi
Copy link

Thanks @crzyjcky ! Worked like magic.

@dtereshenko
Copy link

@crzyjcky It also solve my issues. Thanks!

@krisai
Copy link

krisai commented Jun 27, 2016

npm i fix it for me

@madhusudhand
Copy link

madhusudhand commented Jun 27, 2016

I guess this is the problem with NPM itself.

ember-cli has a dependency "exists-sync": "0.0.3"
where as angular-cli has the same as devDependency.
npm install -g angular-cli doesn't install devDependencies of angular-cli.
But they should get installed inside ember-cli; But it isn't inside ember node-modules.

Same is the case with object-assign, minimatch, through and walk-sync.

@manuelfink
Copy link

@madhusudhand how than can the dependencies for angular-cli / ember-cli be installed?

@manuelfink
Copy link

+1

However npm instal did not solve the problem for me. I do have to run it as root on mac sudo npm install which seems to be really bad practice for me.

I'm running on node 6.2.2 with latest npm 3.10.2

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.2.2
npm ERR! npm  v3.10.2
npm ERR! path ../typescript/bin/tsc
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink

npm ERR! Error: EACCES: permission denied, symlink '../typescript/bin/tsc' -> '/Users/manuelfink/git/angular-2-test/node_modules/angular-cli/node_modules/.bin/tsc'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, symlink '../typescript/bin/tsc' -> '/Users/manuelfink/git/angular-2-test/node_modules/angular-cli/node_modules/.bin/tsc'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../typescript/bin/tsc',
npm ERR!   dest: '/Users/manuelfink/git/angular-2-test/node_modules/angular-cli/node_modules/.bin/tsc',
npm ERR!   parent: 'angular-cli' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v6.2.2
npm ERR! npm  v3.10.2
npm ERR! path npm-debug.log.2854708998
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open

@Rafi993
Copy link

Rafi993 commented Jun 27, 2016

In linux or mac OS you need sudo while running npm if you want to run without sudo you should use nvm or follow the instructions given in here. This is not an issue and it is not related to angular-cli

@Rafi993
Copy link

Rafi993 commented Jun 27, 2016

@cre8 please close the issue if it is solved.

@manuelfink
Copy link

@Rafi993 it seems to be that this is not resolves as of now.

  • .beta8 is missing the above dependencies, which must be manually installed to get angular cli running and than be manually installed within every project.
  • I do agree that root is necessary for installing global packages. However running npm within a project as sudo seems weird to me. Still I'm anyhow not even understanding why I need root privileges for a subfolder which belongs to my user. Maybe just a problem of my mac.

@ghost
Copy link

ghost commented Jul 3, 2016

I get this error message when I try to create new ng project | Os X El Capitan

ng new tg
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. (/usr/local/lib/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)

@filipesilva
Copy link
Contributor

As @Splaktar mentioned, the fix will be out in the next beta (beta.9).

Meanwhile what you can do is to delete node_modules inside your project and run npm install. That should fix every missing module.

@msiddiqi
Copy link

msiddiqi commented Jul 4, 2016

Updating npm to the latest version fixed the issue for me too.

@rbnzdave
Copy link

rbnzdave commented Jul 4, 2016

fresh install of windows 10, new download of node.js, while it installed ng without a problem it hit the sync issue immediately. I've got no package.json file to run, just following a tutorial to

npm install -g angular-cli

ng help

and i get the errors.

@tieppt
Copy link

tieppt commented Jul 4, 2016

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

@ghost
Copy link

ghost commented Jul 4, 2016

New shit happens, I downloaded the node 6.x.x latest version it works fine for the ng new project command, but when I type ng serve it pops up an throw error

Envoyé de mon iPhone

Le 4 juil. 2016 à 12:00, Tiep Phan [email protected] a écrit :

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


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@msiddiqi
Copy link

msiddiqi commented Jul 4, 2016

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

@ghost
Copy link

ghost commented Jul 4, 2016

I did it in /node_modules and in my project, So I really don’t understand

On 4 juillet 2016 at 21:30:50, Muhammad Siddiqi ([email protected])
wrote:

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


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1186 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AKTOFMbBepH69dFIPy2aAnvrll2fuYu6ks5qSV9pgaJpZM4I9KfJ
.

@rbnzdave
Copy link

rbnzdave commented Jul 4, 2016

@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" :)

@rbnzdave
Copy link

rbnzdave commented Jul 4, 2016

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.

@samirthebti
Copy link

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

@ghost
Copy link

ghost commented Jul 5, 2016

Ok, so to all the people who had this problem, please make sure you got the latest & current version of node installed (at this time : node : 6.2.2 and npm : 3.9.5) then install angular-cli by typing
npm install -g angular-cli (sudo if you get warns)
then go to /node_modules, find the angular-cli folder, and run npm install (sudo may be required)
then, start a project ng new projectname go into the new created project folder and type npm i.
Peace !

@mchamo
Copy link

mchamo commented Aug 12, 2016

@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?

@ghost
Copy link

ghost commented Aug 12, 2016

I haven't missed any dependecies, I haven't installed the correct version
of node

Le vendredi 12 août 2016, mchamo [email protected] a écrit :

@ddagone https://github.com/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?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1186 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AKTOFF1riMYT9FULw7dkbOgIPswswwPVks5qe-96gaJpZM4I9KfJ
.

@ctrl-brk
Copy link

ctrl-brk commented Jun 8, 2017

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

@BenRacicot
Copy link

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

@phillipzada
Copy link

The following worked for me.

npm cache clean --force
cd node_modules\@angular\cli
npm i
cd ..\..\..
npm i
ng serve

@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.