vercel / pkg

Package your Node.js project into an executable

Home Page:https://npmjs.com/pkg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support node11

mrvik opened this issue · comments

Building a project with node 11 has this output:

$ pkg -d -b -t linux .
> pkg@4.3.4
> Error! No available node version satisfies 'node11'
$ node -v
v11.1.0
commented

I don't think this repo is maintained anymore

@sharathbaddam with GoogleChromeLabs releasing Carlo and directly referencing Pkg as the preferred packaging strategy I hope we can get some updates. I am also seeing the same error as the OP. I think more people that are trying out Carlo will also run into this roadblock.

Some research returned this file in pkg-fetch needs to be updated.

For each node version, there is a patch to make pkg work (I guess). Maybe for test purposes there is no need of a patch.

Seems like adding a new line in the file linked above makes pkg-fetch happy, let's see if it works...

pkg node11 compilation without patches works, but when using it, there is a error:

AssertionError [ERR_ASSERTION]: Placeholder for not found
    at injectPlaceholder (/home/mrvik/temp/pkg/lib-es5/producer.js:217:38)
    at injectPlaceholders (/home/mrvik/temp/pkg/lib-es5/producer.js:236:3)
    at /home/mrvik/temp/pkg/lib-es5/producer.js:158:9
    at FSReqCallback.oncomplete (fs.js:148:20)

Googling this error I've found (open) issue #323 No workaround or fix found, nobody mentioned it on any commit.
Tried to use patch for node10, but then it doesn't compile due to:

> Checking out v11.1.0
> Applying patches
Hunk #2 succeeded at 2363 (offset -1496 lines).
patching file src/node_contextify.cc
Hunk #1 succeeded at 64 (offset 5 lines).
Hunk #2 FAILED at 632.
Hunk #3 FAILED at 694.
Hunk #4 FAILED at 709.
Hunk #5 FAILED at 730.
4 out of 5 hunks FAILED -- saving rejects to file src/node_contextify.cc.rej
can't find file to patch at input line 438
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- node/src/node_debug_options.cc
|+++ node/src/node_debug_options.cc
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
patching file src/node_main.cc
> Error! Error: patch failed with code 1
    at ChildProcess.<anonymous> (/home/mrvik/temp/pkg-fetch/lib-es5/spawn.js:73:23)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:970:16)
    at Socket.stream.socket.on (internal/child_process.js:387:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:611:12)

It was expected, source can change, so patches cannot be the same.

I'm not sure what's pkg looking for. Maybe the maintainers know what's happening here?

Any thought @igorklopov ?

I have the same problem, I will try and find how to make this work.

Workaround: Use Node 10 with the targets-keyword.

So pkg -d -b -t linux-node10 .

@zentek-marco-bruening no its shows i am using macos. I think latest and lts version should be supported. And it seems this issue will not be solved as it is year old :(

Workaround: Use Node 10 with the targets-keyword.

So pkg -d -b -t linux-node10 .

No a workaround, since Node 10 isn't Node 11! Node 11 has <3 features Node 10 has not.

commented

I've created a pull request vercel/pkg-fetch#65 for Node 12.1.0 support.

Support will be for Node 12 and 14 going forward. Thanks!

https://endoflife.date/nodejs