pkg
pkg copied to clipboard
opts.pkg undefined
What version of pkg are you using?
5.5.2
What version of Node.js are you using?
16.13.0
What operating system are you using?
WSL Ubuntu 20.04, Windows 10
What CPU architecture are you using?
Intel i59400
What Node versions, OSs and CPU architectures are you building for?
node14-linux-x64
Describe the Bug
[email protected] compression: GZip /usr/local/node/lib/node_modules/pkg/node_modules/prebuild-install/util.js:13 major: opts.pkg.version.split('.')[0], ^
TypeError: Cannot read properties of undefined (reading 'split')
at Object.getDownloadUrl (/usr/local/node/lib/node_modules/pkg/node_modules/prebuild-install/util.js:13:29)
at Object.
Expected Behavior
no TypeError
To Reproduce
if i use pkg without nestjs project, this error will disappear.
@seamory Have you found a solution for this?
I encountered a similar error. I am trying to pack a node.js application inside a docker container to a binary file which I want to run in another container.
What version of pkg are you using? 5.5.2
What version of Node.js are you using? 16
What operating system are you using? WSL Ubuntu 20.04, Windows 10
What CPU architecture are you using? Intel i710850 - amd64
What Node versions, OSs and CPU architectures are you building for? node16-linux-x64 (I also tried other node versions, like 10 and 14, but did not work either)
Describe the Bug /usr/local/lib/node_modules/pkg/node_modules/prebuild-install/util.js:13 major: opts.pkg.version.split('.')[0], ^
TypeError: Cannot read properties of undefined (reading 'split')
at Object.getDownloadUrl (/usr/local/lib/node_modules/pkg/node_modules/prebuild-install/util.js:13:29)
at Object.
@seamory Have you found a solution for this?
sorry, i had not found the solution for this, but the error not take any effects to the result.
Same problem here, invoking this command: pkg --targets node16-linux-x64 .
I had this error when one of the packages in node_modules did not have a version in their package.json.
In my case it was the generated .prisma/client
@jnorris441 , have you solved your .prisma
problem? I had the same problem.
@grimmer0125 no I put a version entry into my prisma client package.json before building using pkg
Here's a PR that fixes this in the underlying library https://github.com/prebuild/prebuild-install/pull/184
Closing that PR - the issue is most likely a local package in your monorepo or your root package.json
missing a version field.
This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label
This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.