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: Cannot find module './dist'[BUG] #7126

Closed
samuelruiz2020 opened this issue Jun 28, 2024 · 4 comments
Closed

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

samuelruiz2020 opened this issue Jun 28, 2024 · 4 comments
Labels
bug Something isn't working needs more info Requires more information from poster

Comments

@samuelruiz2020
Copy link

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

  • yarn osd bootstrap
    yarn run v1.22.22
    $ scripts/use_node scripts/osd bootstrap
    node:internal/modules/cjs/loader:1078
    throw err;
    ^
    Error: Cannot find module './dist'
    Require stack:
  • /builds/occne/opensearch-dashboard-mirror/packages/osd-pm/cli.js
  • /builds/occne/opensearch-dashboard-mirror/scripts/osd.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object. (/builds/occne/opensearch-dashboard-mirror/packages/osd-pm/cli.js:31:1)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/builds/occne/opensearch-dashboard-mirror/packages/osd-pm/cli.js',
    '/builds/occne/opensearch-dashboard-mirror/scripts/osd.js'
    ]

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):

  • OS: Oracle Linux 9
@samuelruiz2020 samuelruiz2020 added bug Something isn't working untriaged labels Jun 28, 2024
@joshuali925
Copy link
Member

@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?

@joshuali925 joshuali925 added needs more info Requires more information from poster and removed untriaged labels Jul 2, 2024
@samuelruiz2020
Copy link
Author

samuelruiz2020 commented Jul 9, 2024

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
Copy link
Author

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 zhyuanqi closed this as completed Jul 9, 2024
@zhyuanqi
Copy link
Collaborator

zhyuanqi commented Jul 9, 2024

Close the issue has it has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs more info Requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants