opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.6k stars 822 forks source link

Error: Cannot find module './dist'[BUG] #7126

Closed samuelruiz2020 closed 7 hours ago

samuelruiz2020 commented 1 week ago

Describe the bug

I compile and build a container image using the OSD 2.11.0 github repository, and it's having issues with the ./dist plugin that it can't find. Also zlib is unable to install because it gets a message node-waf: command not found. I searched for resolutions and those did not help me.

Node.js v18.16.0 yarn run v1.22.22

A clear and concise description of what the bug is.

To Reproduce

Expected behavior Install packages , dependencies and bootstrap correctly OSD 2.11.0

OpenSearch Version 2.11.0

Dashboards Version OSD 2.11.

Plugins ./dist

Host/Environment (please complete the following information):

joshuali925 commented 1 week ago

@samuelruiz2020 thanks for adding an issue. dist is part of the repo: https://github.com/opensearch-project/OpenSearch-Dashboards/tree/2.11.0/packages/osd-pm/dist

you can check under /builds/occne/opensearch-dashboard-mirror/packages/osd-pm/dist, does it actually exist? and could you also add the output of git status?

samuelruiz2020 commented 8 hours ago

hi @joshuali925 Thanks for support. The packages/osd-pm/dist path and index.js file did not exist because push rules in my gitlab repo, It was solved. Now, the issue is that i am using a corporate yarn registry and it is stuck when resolving packages, how can i fix it?, because not very clear if i need to use encodeURIComponent() or encodeURI() and where to use it

$ scripts/use_node scripts/osd bootstrap
 info [opensearch-dashboards] running yarn
$ scripts/use_node ./preinstall_check
[1/5] Validating package.json...
[2/5] Resolving packages...
error TypeError [ERR_UNESCAPED_CHARACTERS]: https://artifactory/api/npm/global-dev-npm/œdist: Request path contains unescaped characters
    at new NodeError (node:internal/errors:399:5)
    at new ClientRequest (node:_http_client:184:13)
    at Object.request (node:https:360:10)
    at module.exports.Request.start (/usr/lib/node_modules/yarn/lib/cli.js:141972:32)
    at module.exports.Request.end (/usr/lib/node_modules/yarn/lib/cli.js:142731:10)
    at end (/usr/lib/node_modules/yarn/lib/cli.js:141785:14)
    at Immediate.<anonymous> (/usr/lib/node_modules/yarn/lib/cli.js:14[179](https://cloudlab.us.oracle.com/occne/opensearch-dashboard-mirror/-/jobs/63831169#L179)9:7)
    at process.processImmediate (node:internal/timers:476:21)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ERROR [bootstrap] failed:
ERROR Error: Command failed with exit code 1: /usr/lib/node_modules/yarn/bin/yarn.js install --non-interactive
          at makeError (/builds/occne/opensearch-dashboard-mirror/packages/osd-pm/dist/index.js:26834:11)
          at handlePromise (/builds/occne/opensearch-dashboard-mirror/packages/osd-pm/dist/index.js:25770:26)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          at async installInDir (/builds/occne/opensearch-dashboard-mirror/packages/osd-pm/dist/index.js:25493:3)
          at async Project.installDependencies (/builds/occne/opensearch-dashboard-mirror/packages/osd-pm/dist/index.js:15231:5)
          at async Object.run (/builds/occne/opensearch-dashboard-mirror/packages/osd-pm/dist/index.js:9[188](https://cloudlab.us.oracle.com/occne/opensearch-dashboard-mirror/-/jobs/63831169#L188):11)
          at async runCommand (/builds/occne/opensearch-dashboard-mirror/packages/osd-pm/dist/index.js:58240:5)
          at async Object.run (/builds/occne/opensearch-dashboard-mirror/packages/osd-pm/dist/index.js:278:3)
error Command failed with exit code 1. 
samuelruiz2020 commented 8 hours ago

Ignore it , i fixed it, it was a dependency defined wrongly in package.json file , my bad. Thanks for support again. You can close it.

zhyuanqi commented 7 hours ago

Close the issue has it has been resolved.