-
Notifications
You must be signed in to change notification settings - Fork 731
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 in ...lib/utils.js Module not found: Error: Can't resolve 'path' in '.../node_modules/elasticsearch/src/lib' #661
Comments
Got the same problem here, pretty curious how to solve this. |
Do either of you have time to create a reproduction project that I can use to debug? I'm unfamiliar with Angular 2+ and would take a while to get to the point of debugging this. |
Thanks @spalger , I attached here a short Angular 6 project. Here is the instruction how to re-produce the issue:
You will get this log in command line:
Please let me know if you see any problem. Thanks a lot, Son Lam. |
@spalger sure. BTW I just found the solution, it is a little bit weird. Fix: use UMD import syntax instead: EDIT: Nope, does not work. See comments below I just have created a sample project, you can download it until 30 days: https://ufile.io/w7m0i In order to run it locally, you need to do the following:
The file you are interested in is src/app/app.component.ts. I've put the two import versions, uncomment the one you are interested in. |
@Son-lan that is what we call a message percussion :) |
@spalger , 👍 :-) it is good that it takes only few minutes to create the test case. I tried your solution but it does not seem to fix my problem. My code is very simple:
Could take another look? Thanks, Son Lam. |
@Son-Lam are you sure you don't have any other references to elasticsearch somewhere else in your code? I've copy/pasted your service in my project and it does compile: |
@spalger , Thanks a lot for looking into it. Could you check what version of NodeJs do you have? That the only place I have a reference to elasticsearch. If you extract the attached "poc-elasticsearch_2.zip" file above. Thanks, |
I am sorry, it compiled, but I was not importing the service in my providers. When I did then the problem went back again. |
It is great. We are on the same page now. I hope @spalger could help to solve this issues faster. Thanks a lot. |
@Son-Lam looks like it's a cli problem, not only with path. Many people are having troubles right now: angular/angular-cli#10681 I tried this solution but didn't worked: angular/angular-cli#10681 (comment) |
@YoannBureau , I have upgraded to version 15.0.0 and the error went away 👍 . Could you try and confirm it has been fixed for you too? |
Solution: upgrade to version 15.0.0. |
@Son-Lam which package you upgraded to 15.0.0 |
Upgrading to 15.0.0 doesn't solve my problem. Any Other Solution? @Son-Lam |
Install the require dependencies using this line below |
this didnt help me |
Installing deps made a couple of similar errors to go away for me, but not all of them. :( |
Hello,
I am first time Elasticsearch user. I am trying to use it in my Angular 6 project (Angular 6, Rxjs 6, Node 10.1.0). I am getting this error while compiling:
ERROR in ./node_modules/elasticsearch/src/lib/utils.js
Module not found: Error: Can't resolve 'path' in '/.../node_modules/elasticsearch/src/lib'.
Could you help to resolve it.
Best Regards,
The text was updated successfully, but these errors were encountered: