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 'exists-sync' #1201

Closed
MarsWang42 opened this issue Jun 24, 2016 · 8 comments · Fixed by #1250
Closed

Error: Cannot find module 'exists-sync' #1201

MarsWang42 opened this issue Jun 24, 2016 · 8 comments · Fixed by #1250

Comments

@MarsWang42
Copy link

MarsWang42 commented Jun 24, 2016

osx: El Captain,
node: v 6.2.2,
npm: v 3.10.3

Angular cli created new project well, but when I using ' ng server ' to start the server following error comes out. Anybody knows how to solve?

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. (/Users/Mars/Google Drive/Front-End/Project1/hello/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)

@swfree
Copy link

swfree commented Jun 24, 2016

Running this command fixed the issue for me. It will install the missing module 'exists-sync':
npm install --save exists-sync

@MarsWang42
Copy link
Author

@swfree
Thx! But after installing the module it stiil crashed when I try to start the server. This time the error message looks like

(node:7087) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
The Broccoli Plugin: [BroccoliTypeScriptCompiler] failed with:
Error: Typescript found the following errors:
.../Project1/hello/tmp/broccoli_type_script_compiler-input_base_path-dvBqPqwe.tmp/0/src/typings.d.ts (5, 1): File '.../Project1/hello/tmp/broccoli_type_script_compiler-input_base_path-dvBqPqwe.tmp/0/typings/browser.d.ts' not found.

@swfree
Copy link

swfree commented Jun 24, 2016

@Marswang92
This seems to be an error related to how typings was configured. Maybe it can be solved by creating a browser.d.ts file in your typings folder. I'm not too sure though, so you might be able to find a solution by looking at responses to some other similar issues:
typings/typings#151
angular/angular#5807
microsoft/TypeScript#7369

@hcsadm
Copy link

hcsadm commented Jun 24, 2016

@Marswang92
I also received the same error when running 'ng serve' after creation of a new project with angular-cli. To solve this, I ran the "npm install" command from within the new project's folder. I was then able to run "ng serve" successfully.

@simonstewart
Copy link

I had similar issues while running:
npm version 2.14.12
node version 4.3.0

After updating to node version 6.2.2 and npm 3.9.5 all is working OK.

Maybe worth giving that a shot?

@Splaktar
Copy link
Member

Duplicate of #1186. This should be closed.

@JoshWilliams92
Copy link

JoshWilliams92 commented Jun 27, 2016

Run npm install in the angular-cli folder globally and then run ng -v to check if working. After you have created a new project with the ng new command and ng serve should not work until you go into node_modules and angular-cli in your root project and npm install again.

filipesilva added a commit to filipesilva/angular-cli that referenced this issue Jun 30, 2016
The npm task from our current ember-cli install uses npm 2.x.x, which was causing issues with some of the dependencies.

This PR copies over all files needed for the npm-install task but uses a local 3.10.2 npm version instead.

Fix angular#1186
Fix angular#1191
Fix angular#1201
Fix angular#1209
Fix angular#1207
Fix angular#1248
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Jun 30, 2016
The npm task from our current ember-cli install uses npm 2.x.x, which was causing issues with some of the dependencies.

This PR copies over all files needed for the npm-install task but uses a local 3.10.2 npm version instead.

Fix angular#1186 (main issue)
Fix angular#1191
Fix angular#1201
Fix angular#1209
Fix angular#1207
Fix angular#1248
filipesilva added a commit that referenced this issue Jun 30, 2016
The npm task from our current ember-cli install uses npm 2.x.x, which was causing issues with some of the dependencies.

This PR copies over all files needed for the npm-install task but uses a local 3.10.2 npm version instead.

Fix #1186 (main issue)
Fix #1191
Fix #1201
Fix #1209
Fix #1207
Fix #1248
@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 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants