I am trying to install ng2-completer. It work just fine when I run ng serve
. However, my ng build --prod
. I get following error
Module not found: Error: Can't resolve 'ng2-completer/ng2-completer.module' in 'folder_path/front/src/app'
My package-lock.json is as follows:
"ng2-completer": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/ng2-completer/-/ng2-completer-2.0.6.tgz",
"integrity": "sha1-IeW3sZft5jLYeDbMzxOSEWda2gs="
},
I have tried importing package following ways:
import { Ng2CompleterModule } from '../../../../node_modules/ng2-completer/';
or
import { Ng2CompleterModule } from 'ng2-completer/';
I still get following error:
Module not found: Error: Can't resolve 'ng2-completer/ng2-completer.module' in '/User/test/Document/front/src/app'
any help is appreciated, thanks
I had the same issue with the 2.0.6 version of ng2-completer. I don't know the reason, but it seems that the problem does not occur in the previous version. As a quick fix You can try downgrading it to the 1.x:
$ npm install ng2-completer@^1.0.0 --save