Skip to content

ENOENT: no such file or directory, src/app/app.module.ts' #1695

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

Closed
albanx opened this issue Aug 15, 2016 · 8 comments
Closed

ENOENT: no such file or directory, src/app/app.module.ts' #1695

albanx opened this issue Aug 15, 2016 · 8 comments
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@albanx
Copy link

albanx commented Aug 15, 2016

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    MAC yosemite
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
angular-cli: 1.0.0-beta.11-webpack.2
node: 4.4.7
os: darwin x64
alban-mac:public
  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
ng g component test.component

Just trying to create a module with the webpack. To note that I have renamed my app.module to mytestapp.module

Cheers

@filipesilva
Copy link
Contributor

Did you also change the import in main.ts to use your renamed mytestapp.module file?

@filipesilva filipesilva added the needs: more info Reporter must clarify the issue label Aug 19, 2016
@albanx
Copy link
Author

albanx commented Aug 19, 2016

@filipesilva Yes I did.

@monojack
Copy link
Contributor

Are you importing it somewhere else using app.module? Maybe inside a barrel or something?

@albanx
Copy link
Author

albanx commented Aug 19, 2016

@monojack I made a search in the code, and I cannot find app.module, the application is working fine, and the cli works fine, except for the fact that it complains about app.module:

$ ng g component shared/components/lang-selector.component
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
installing component
  create src/app/shared/components/lang-selector/lang-selector.component.css
  create src/app/shared/components/lang-selector/lang-selector.component.html
  create src/app/shared/components/lang-selector/lang-selector.component.spec.ts
  create src/app/shared/components/lang-selector/lang-selector.component.ts
  create src/app/shared/components/lang-selector/index.ts
ENOENT: no such file or directory, open '/export/www/alban/mytestapp/public_web/src/app/app.module.ts'
Error: ENOENT: no such file or directory, open '/export/www/alban/mytestapp/public_web/src/app/app.module.ts'
    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.readFileSync (fs.js:397:15)
    at getSource (/export/www/alban/mytestapp/public_web/node_modules/angular-cli/addon/ng2/utilities/ast-utils.ts:24:45)
    at _addSymbolToNgModuleMetadata (/export/www/alban/mytestapp/public_web/node_modules/angular-cli/addon/ng2/utilities/ast-utils.ts:137:18)
    at Object.addComponentToModule (/export/www/alban/mytestapp/public_web/node_modules/angular-cli/addon/ng2/utilities/ast-utils.ts:235:12)
    at Class.module.exports.files.fileList.afterInstall.options [as afterInstall] (/export/www/alban/mytestapp/public_web/node_modules/angular-cli/addon/ng2/blueprints/component/index.js:138:18)
    at lib$rsvp$$internal$$tryCatch (/export/www/alban/mytestapp/public_web/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/export/www/alban/mytestapp/public_web/node_modules/rsvp/dist/rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (/export/www/alban/mytestapp/public_web/node_modules/rsvp/dist/rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (/export/www/alban/mytestapp/public_web/node_modules/rsvp/dist/rsvp.js:1198:9)
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)

@filipesilva filipesilva added type: bug/fix command: generate P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs: more info Reporter must clarify the issue labels Aug 23, 2016
@filipesilva
Copy link
Contributor

I think I know what the issue is. @hansl @Brocco currently the addComponentToModule functionality seems to be assuming app.module.ts. This needs a module discovery mechanism instead of a hardcoded file.

@Brocco
Copy link
Contributor

Brocco commented Aug 23, 2016

This is something that I will be working on soon, once I finish another related feature.

@Brocco
Copy link
Contributor

Brocco commented Sep 19, 2016

This issue was resolved by PR #1966, closing

@Brocco Brocco closed this as completed Sep 19, 2016
@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

No branches or pull requests

5 participants