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: Can't find module "ng2-typeahead'. #17

Open
Fresh-Dev-zunairzakir opened this issue Oct 4, 2016 · 5 comments
Open

Error: Can't find module "ng2-typeahead'. #17

Fresh-Dev-zunairzakir opened this issue Oct 4, 2016 · 5 comments

Comments

@Fresh-Dev-zunairzakir
Copy link

Fresh-Dev-zunairzakir commented Oct 4, 2016

Hi All,

An issue regarding adding "ng2-typeahead' module.
I have added "ng2-typeahead' through npm and its properly added in my node_modules folder but

when I do :
import { Typeahead } from 'ng2-typeahead';
Error: Can't find module "ng2-typeahead'.

It's only working when I do:

import { Typeahead } from '../../../node_modules/ng2-typeahead/src/ng2-typeahead';

Can any body guide me why I need to give path from node_modules ?

@cederlof
Copy link

I have the same problem.

@skgyan
Copy link

skgyan commented Nov 16, 2016

Facing the same issue.

@BCaldas
Copy link

BCaldas commented Nov 16, 2016

I've got the same probleam. Any solution?

@BCaldas
Copy link

BCaldas commented Nov 16, 2016

My coworker has solved the probleam. You need create a Typescript file (.ts) named index.ts inside the \node_modules\ng2-typeahead directory and put this content inside:

export * from './src/ng2-typeahead';

it works to us. I hope it can help you!

@julienboulay
Copy link

Adding a new file in node_modules is not the recommended way. You can also simply import the module like this:
import { Typeahead } from 'ng2-typeahead/src/ng2-typeahead';

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

5 participants