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

Install binary package via common package managers (winget, brew, etc) #199

Open
cpendery opened this issue Mar 9, 2024 · 3 comments
Open
Labels
feature-request Request for new features or functionality

Comments

@cpendery
Copy link
Member

cpendery commented Mar 9, 2024

Combining #110, #32, #82, & #84 to make it easier for people to track the resolution.

As discussed in #32 (comment), there isn't a feasible solution yet to making the binary package that would enable distributing inshellisense via package manager. If Node 21 or Bun support gets added to node-pty, I'll retry those methods of creating the binary package. I don't want to create a dependency on any archived projects for now

@alanhg
Copy link
Contributor

alanhg commented Apr 14, 2024

I've been trying to package it into brew. but have encountered an error in actual testing that hasn't been resolved yet.

The root cause of the following two errors is because node-pty is not compiled to the right version. I manually deleted @homebridge/node-pty-prebuilt-multiarch and executed npm i and it was back to normal.

My version under /usr/local/bin/node is v18.16.1.

innerError Error: Cannot find module '../build/Debug/pty.node'
Require stack:
- /opt/homebrew/Cellar/inshellisense/0.0.1-rc.13/libexec/lib/node_modules/@microsoft/inshellisense/node_modules/@homebridge/node-pty-prebuilt-multiarch/lib/prebuild-loader.js
- /opt/homebrew/Cellar/inshellisense/0.0.1-rc.13/libexec/lib/node_modules/@microsoft/inshellisense/node_modules/@homebridge/node-pty-prebuilt-multiarch/lib/unixTerminal.js
- /opt/homebrew/Cellar/inshellisense/0.0.1-rc.13/libexec/lib/node_modules/@microsoft/inshellisense/node_modules/@homebridge/node-pty-prebuilt-multiarch/lib/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/opt/homebrew/Cellar/inshellisense/0.0.1-rc.13/libexec/lib/node_modules/@microsoft/inshellisense/node_modules/@homebridge/node-pty-prebuilt-multiarch/lib/prebuild-loader.js:10:15)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/opt/homebrew/Cellar/inshellisense/0.0.1-rc.13/libexec/lib/node_modules/@microsoft/inshellisense/node_modules/@homebridge/node-pty-prebuilt-multiarch/lib/prebuild-loader.js',
    '/opt/homebrew/Cellar/inshellisense/0.0.1-rc.13/libexec/lib/node_modules/@microsoft/inshellisense/node_modules/@homebridge/node-pty-prebuilt-multiarch/lib/unixTerminal.js',
    '/opt/homebrew/Cellar/inshellisense/0.0.1-rc.13/libexec/lib/node_modules/@microsoft/inshellisense/node_modules/@homebridge/node-pty-prebuilt-multiarch/lib/index.js'
  ]
}
node:internal/modules/cjs/loader:1340
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The module '/opt/homebrew/Cellar/inshellisense/0.0.1-rc.13/libexec/lib/node_modules/@microsoft/inshellisense/node_modules/@homebridge/node-pty-prebuilt-multiarch/build/Release/pty.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 120. This version of Node.js requires
NODE_MODULE_VERSION 108. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Module._extensions..node (node:internal/modules/cjs/loader:1340:18)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/opt/homebrew/Cellar/inshellisense/0.0.1-rc.13/libexec/lib/node_modules/@microsoft/inshellisense/node_modules/@homebridge/node-pty-prebuilt-multiarch/lib/prebuild-loader.js:6:11)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v18.16.1

@alanhg
Copy link
Contributor

alanhg commented Apr 15, 2024

Combining #110, #32, #82, & #84 to make it easier for people to track the resolution.

As discussed in #32 (comment), there isn't a feasible solution yet to making the binary package that would enable distributing inshellisense via package manager. If Node 21 or Bun support gets added to node-pty, I'll retry those methods of creating the binary package. I don't want to create a dependency on any archived projects for now

@cpendery For advice, what exactly do you mean by archived projects here?

@cpendery
Copy link
Member Author

cpendery commented Apr 15, 2024

Combining #110, #32, #82, & #84 to make it easier for people to track the resolution.
As discussed in #32 (comment), there isn't a feasible solution yet to making the binary package that would enable distributing inshellisense via package manager. If Node 21 or Bun support gets added to node-pty, I'll retry those methods of creating the binary package. I don't want to create a dependency on any archived projects for now

@cpendery For advice, what exactly do you mean by archived projects here?

If we migrated everything into common js, we might be able to use pkg to compile our code into a binary executable which would be easier to distribute. It handles compiling node-pty, so we could stop using the @homebrew version, but I didn't want to depend on the project since they just deprecated it in January

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants