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

Cannot find module 'exists-sync'

Open cre8 opened this issue 10 years ago • 48 comments

  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.

cre8 avatar Jun 23 '16 19:06 cre8

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

elliott-davis avatar Jun 23 '16 20:06 elliott-davis

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

scrivy avatar Jun 23 '16 21:06 scrivy

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)

Rafi993 avatar Jun 24 '16 01:06 Rafi993

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

tieppt avatar Jun 24 '16 05:06 tieppt

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

crzyjcky avatar Jun 24 '16 05:06 crzyjcky

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

littleStudent avatar Jun 24 '16 06:06 littleStudent

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.

KarlPurk avatar Jun 24 '16 13:06 KarlPurk

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

ghost avatar Jun 24 '16 13:06 ghost

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

Codermar avatar Jun 24 '16 14:06 Codermar

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

M4RTO avatar Jun 24 '16 14:06 M4RTO

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

Codermar avatar Jun 24 '16 14:06 Codermar

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

M4RTO avatar Jun 24 '16 15:06 M4RTO

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

rijine avatar Jun 24 '16 16:06 rijine

ran npm install and worked for me

david-lee avatar Jun 25 '16 13:06 david-lee

npm install and worked for me Thanks!

Thanks @crzyjcky ! Worked like magic.

jprinaldi avatar Jun 26 '16 13:06 jprinaldi

@crzyjcky It also solve my issues. Thanks!

dtereshenko avatar Jun 26 '16 15:06 dtereshenko

npm i fix it for me

krisai avatar Jun 27 '16 03:06 krisai

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.

madhusudhand avatar Jun 27 '16 09:06 madhusudhand

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

manuelfink avatar Jun 27 '16 11:06 manuelfink