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

Can you provide support for node v18? #354

Closed
Suo-Ran opened this issue Jan 21, 2024 · 15 comments
Closed

Can you provide support for node v18? #354

Suo-Ran opened this issue Jan 21, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@Suo-Ran
Copy link

Suo-Ran commented Jan 21, 2024

Clear and concise description of the problem

I'm using @naria2/node for my electron applications to automatically build the system version for cross-platform use. However, even the latest stable version of electron does not have node versions up to V20, and there are still many bugs to be fixed in 26, 27, and 28, so node V18 is still a very high share of electron applications. Is it possible to support @naria2/node over v18?

Suggested solution

No response

Additional context

No response

@Suo-Ran Suo-Ran added the enhancement New feature or request label Jan 21, 2024
@yjl9903
Copy link
Owner

yjl9903 commented Jan 22, 2024

I think this package does not use any latest node features. So it should work in node v18?

And I am not very familiar with electron. I don't know how electron bundle your desktop app? @naria2/node does things like other native packages like esbuild, swc, that it includes different binary deps for different platform (see https://github.com/yjl9903/naria2/tree/main/packages/binary)

Maybe I can republish it changing node version to v18? Or can you provide more information or minial reproduction for further debugging?

@Suo-Ran
Copy link
Author

Suo-Ran commented Jan 22, 2024

I think this package does not use any latest node features. So it should work in node v18?

And I am not very familiar with electron. I don't know how electron bundle your desktop app? @naria2/node does things like other native packages like esbuild, swc, that it includes different binary deps for different platform (see https://github.com/yjl9903/naria2/tree/main/packages/binary)

Maybe I can republish it changing node version to v18? Or can you provide more information or minial reproduction for further debugging?

I ran it independently and found that it didn't work with node v18, which is v18.16.0
Here's my test code:

index.js

import { createClient } from "naria2";
import { createChildProcess } from "@naria2/node";

const client = await createClient(createChildProcess());

console.log(client.options);

package.json

{
  "name": "test-naria2-node",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "author": "",
  "type": "module",
  "license": "ISC",
  "dependencies": {
    "@naria2/node": "^0.0.24",
    "naria2": "^0.0.24"
  }
}

@yjl9903
Copy link
Owner

yjl9903 commented Jan 22, 2024

Maybe it is related with the upstream library maria2. It does some polyfill to support different platforms.

I find it terminates at this import

https://github.com/hydrati/maria2/blob/764c038a50d33a086fe1377dbe3327636a9e9544/src/shared.ts#L24

@yjl9903
Copy link
Owner

yjl9903 commented Jan 22, 2024

I patch maria2 manually, could you try the latest 0.0.25?

Related issue: hydrati/maria2#15

@Suo-Ran
Copy link
Author

Suo-Ran commented Jan 22, 2024

I patch maria2 manually, could you try the latest 0.0.25?

Related issue: hydrati/maria2#15

Unfortunately, the result is the same. My node version is v18.16.0

@yjl9903
Copy link
Owner

yjl9903 commented Jan 22, 2024

In my env, it works ok :(

$ pnpm dlx envinfo --system --binaries --browsers
  System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1
    Memory: 39.78 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/Library/Caches/fnm_multishells/52082_1705906398782/bin/node
    npm: 9.5.1 - ~/Library/Caches/fnm_multishells/52082_1705906398782/bin/npm
    pnpm: 8.14.1 - ~/Library/pnpm/pnpm
  Browsers:
    Safari: 17.2.1

@yjl9903 yjl9903 added bug Something isn't working and removed enhancement New feature or request labels Jan 22, 2024
@Suo-Ran
Copy link
Author

Suo-Ran commented Jan 22, 2024

In my env, it works ok :(

$ pnpm dlx envinfo --system --binaries --browsers
  System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1
    Memory: 39.78 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/Library/Caches/fnm_multishells/52082_1705906398782/bin/node
    npm: 9.5.1 - ~/Library/Caches/fnm_multishells/52082_1705906398782/bin/npm
    pnpm: 8.14.1 - ~/Library/pnpm/pnpm
  Browsers:
    Safari: 17.2.1

This is my env, it looks like it should be a matter of operating system differences, mine is PC

  System:
    OS: Windows 11 10.0.22621
    CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12900K
    Memory: 39.48 GB / 63.76 GB
  Binaries:
    Node: 18.16.0 - ~\software\nodejs\node.EXE
    Yarn: 1.22.19 - ~\software\nodejs\yarn.CMD
    npm: 9.5.1 - ~\software\nodejs\npm.CMD
    pnpm: 8.6.5 - ~\software\nodejs\pnpm.CMD
  Browsers:
    Edge: Chromium (120.0.2210.133)
    Internet Explorer: 11.0.22621.1

@Suo-Ran
Copy link
Author

Suo-Ran commented Jan 22, 2024

@Suo-Ran
Copy link
Author

Suo-Ran commented Jan 22, 2024

I patch maria2 manually, could you try the latest 0.0.25?

Related issue: hydrati/maria2#15

Looks like it's not merging pr

@yjl9903
Copy link
Owner

yjl9903 commented Jan 22, 2024

I patch maria2 manually, could you try the latest 0.0.25?
Related issue: hydrati/maria2#15

Looks like it's not merging pr

I have patched the package, so naria2 is not affected by the upstream. I am not sure whether patch works.

Since that PR have merged, I will upgrade it tonight.

@Suo-Ran
Copy link
Author

Suo-Ran commented Jan 23, 2024

I patch maria2 manually, could you try the latest 0.0.25?
Related issue: hydrati/maria2#15

Looks like it's not merging pr

I have patched the package, so naria2 is not affected by the upstream. I am not sure whether patch works.

Since that PR have merged, I will upgrade it tonight.

I cloned the code, the local link was running successfully, but the download from npm still executed that part of the code, it seems that the patch is not fully effective

@yjl9903
Copy link
Owner

yjl9903 commented Jan 23, 2024

I will upgrade naria2 after maria2 being published this Sat, for now you can do similiar patch in your project.

@Suo-Ran
Copy link
Author

Suo-Ran commented Feb 19, 2024

I will upgrade naria2 after maria2 being published this Sat, for now you can do similiar patch in your project.

When is the next release scheduled, since it's been a while :)

@yjl9903
Copy link
Owner

yjl9903 commented Feb 19, 2024

For the upstream maria2 has not been updated...

@yjl9903
Copy link
Owner

yjl9903 commented Sep 13, 2024

It should be resolved in hydrati/maria2@4947c12

and naria2 0.0.26

@yjl9903 yjl9903 closed this as completed Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants