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

Can't find app module when requiring from another module #30

Closed
jorbascrumps opened this issue Jun 12, 2015 · 1 comment
Closed

Can't find app module when requiring from another module #30

jorbascrumps opened this issue Jun 12, 2015 · 1 comment

Comments

@jorbascrumps
Copy link

Given the following app structure, it does not appear possible to have one app-level module require another:

| app/
| -- node_modules/
| ---- module-one/
| ------ index.ts
| ---- module-two/
| ------ index.ts

Trying to import module-one from inside module-two..

import ModuleOne = require('module-one');

.. results in the following error:

error TS2307: Cannot find external module 'module-one'.

This works if module-two is at the app root level. Is there any way around this?

@svallory
Copy link
Member

The correct syntax for that is import ModuleOne = require('../module-one');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants