I am getting the same error as https://github.com/zeit/pkg/issues/296
````C:\webapps\clibu>pkg server/clibu1.js
[email protected]
Targets not specified. Assuming:
node7-linux-x64, node7-macos-x64, node7-win-x64
Error! No available node version satisfies 'node7'
and
C:\webapps\clibu>pkg server/clibu1.js --targets node7
[email protected]
Error! No available node version satisfies 'node7'
On Windows 10 using nvm:
C:\webapps\clibu>node -v
v7.7.4
````
````
C:\webapps\clibu>nvm list
C:\webapps\clibu>pkg server/clibu1.js --targets node7.7.4
[email protected]
Error! No available node version satisfies 'node7.7.4'
````
有解决办法了吗
I had the same issue. Now I installed node 9 by this instructions and run pkg:
$ pkg -t node9-linux .
> [email protected]
> Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v9.2.1-linux-x64 [====================] 100%
...
It works!
I believe it is an issue with version 4.3.1. I had a similar issue but it is fixed once I update pkg to 4.3.3.
i'm using node9. Issue happened when node9+pkg 4.3.3. Works after downgrading to pkg 4.3.1
Experienced the same issue as @weching using 4.3.3. Downgrading to 4.3.1 solved the problem.
In pkg-fetch/lib/index.js, there is this piece of code:
`
function satisfyingNodeVersion () {
const versions = Object.keys(patchesJson)
.filter((nv) => semver.satisfies(nv, nodeRange) ||
nodeRange === 'latest')
.sort((nv1, nv2) => semver.gt(nv1, nv2));
return versions.pop();
}
`
So it means that only node versions where there are entries in patches.json can be used with pkg.
When looking at patches.json, there is only entries for "v10.4.1", "v8.11.3", "v8.9.0", "v6.11.5", "v4.8.5" and "v0.12.18".
Does that mean that node7 and node9 are not supported by pkg ?
pkg dist/bundle.js --targets node9-alpine-x64 --output pkg/app works fine with 4.3.1 but does not work with current version 4.3.3
Error! No available node version satisfies 'node9'
Also getting this error, any idea?
4.3.4 still has this issue, finally I downgrade to 4.3.1 to make node9 works.
I did the same, downgraded to 4.3.1 works
I have the same problem, node8 and node10 work but node9 does not.
I does Not dry IT, but your next Product ncc can do The Same Job or?
for future references, here's the list of supported versions:
{
"v10.4.1": [
"node.v10.4.1.cpp.patch"
],
"v8.11.3": [
"node.v8.11.3.cpp.patch"
],
"v8.9.0": [
"node.v8.9.0.cpp.patch"
],
"v6.11.5": [
"node.v6.11.5.cpp.patch"
],
"v4.8.5": [
"backport.R32768.patch",
"backport.PR4777.for.N4.patch",
"backport.PR5159.for.N4.patch",
"backport.PR5343.for.N4.patch",
"node.v4.8.5.cpp.patch"
],
"v0.12.18": [
"backport.R00000.patch",
"backport.R24002.patch",
"backport.R24204.patch",
"backport.R24262.patch",
"backport.R24266.patch",
"backport.R24523.patch",
"backport.R24543.patch",
"backport.R24639.patch",
"backport.R24642.patch",
"backport.R24643.patch",
"backport.R24644.patch",
"backport.R24824.patch",
"backport.R25039.patch",
"backport.R25444.patch",
"backport.PR4777.for.N0.patch",
"backport.PR5343.for.N0.patch",
"node.v0.12.18.cpp.patch"
]
}
taken from https://github.com/zeit/pkg-fetch/blob/master/patches/patches.json
Most helpful comment
i'm using node9. Issue happened when node9+pkg 4.3.3. Works after downgrading to pkg 4.3.1