gpt4 book ai didi

node.js - ./node_modules/elasticsearch/src/lib/utils.js 中的错误找不到模块 : Error: Can't resolve 'path' in\node_modules\elasticsearch\src\lib'

转载 作者:太空宇宙 更新时间:2023-11-04 00:10:06 27 4
gpt4 key购买 nike

我试图将我的 Angular 5 代码迁移到 Angular 6。

将elasticsearch客户端从“elasticsearch”:“^14.2.1”迁移到“elasticsearch”:“^14.2.2”后,在启动角度代码时出现以下错误。

npm start

ERROR in ./node_modules/elasticsearch/src/lib/utils.js
Module not found: Error: Can't resolve 'path' in
'\ui_angular_6\node_modules\elasticsearch\src\lib'
: Failed to compile.

包.json

"dependencies": {
"@angular/animations": "6.0.0",
"@angular/common": "6.0.0",
"@angular/compiler": "6.0.0",
"@angular/core": "6.0.0",
"@angular/flex-layout": "^5.0.0-beta.14",
"@angular/forms": "6.0.0",
"@angular/http": "6.0.0",
"@angular/platform-browser": "6.0.0",
"@angular/platform-browser-dynamic": "6.0.0",
"@angular/router": "6.0.0",
"@ng-bootstrap/ng-bootstrap": "^1.1.2",
"angular-datatables": "^5.0.0",
"angular-font-awesome": "^3.1.2",
"body-parser": "^1.18.2",
"bootstrap": "^4.1.0",
"core-js": "^2.4.1",
"elasticsearch": "^14.2.2",
"express": "^4.16.3",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"ng2-pdf-viewer": "^4.1.2",
"popper.js": "^1.14.3",
"rxjs": "^6.1.0",
"rxjs-compat": "^6.1.0",
"underscore": "^1.8.3",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular/cli": "6.0.0",
"@angular/compiler-cli": "6.0.0",
"@angular/language-service": "6.0.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/jquery": "^3.3.1",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "^2.7.2",
"@angular-devkit/build-angular": "~0.6.0"

}

请帮我解决这个问题。

最佳答案

将 Elastic search 客户端更新到 15.1.1 解决了我的问题

"elasticsearch": "^15.1.1",

关于node.js - ./node_modules/elasticsearch/src/lib/utils.js 中的错误找不到模块 : Error: Can't resolve 'path' in\node_modules\elasticsearch\src\lib',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50184318/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com