-
Notifications
You must be signed in to change notification settings - Fork 1k
Error when using getmac package #519
Comments
Can you upload your sample test case to a git repo somewhere and include the package.lock.json file in it. I’ll start debugging it in 12 hours, as bed time here. |
So getmac uses editions, and when editions tries to load (editions uses errlop), it encounters and error with errlop, which uses editions, so editions doesn’t even load. It seems this is due to pkg not supporting editions. Either pkg adds support for editions, or we update the hundreds of packages that use editions to supprt pkg, which I guess would be including this gardbage everywhere:
It would be much better if pkg followed the type annotation in the index.js files that do the editions magic, and bundles what the type annotation suggests. This is what typescript does. That convention is already being followed by new packages using editions, and will make its way to all the others soon enough.
|
You can find the example here: https://github.com/t16n/getmactest To replicate:
|
Also is not working with nexe. After I've commented the getmac was working again. |
The problem is pkg doesn’t include the necessary files, as it doesn’t support dynamic values for require statements. The pkg authors will need to support editions or support |
With the release of ncc, I wanted to see if anything has changed:
So ncc works fine, however pkg gives the known editions failure. This still means that:
The correct title of this issue should be called |
I can confirm this, pkg still doesn't work with packages using "editions", e.g. https://www.npmjs.com/package/envfile ... gives errors like
|
For what it's worth, Zeit haven't given any explicit interest in resolving this issue (be it workaround or not): vercel/ncc#236 |
@balupton hm, that's sad :( Since only one package was affected in my case, I switched from "envfile" to "js-yaml" and converted my .env file to a yaml file ... but in general the packages using "editions" seem to be quite popular, so it would be really cool to be able to use them with pkg/ncc. |
@balupton is there any workaround for this error : Error: There were no suitable editions for package [/snapshot/movies2/node_modules/envfile/package.json] ? |
@iseedouble just got to wait for zeit, onus is on them, however they don't seem to care, so I've been gradually moving away from their ecosystem over the last year, details a few comments back |
I've run into this while cross-compiling for armv7 - has anyone found a workaround? |
Try with getmac v4 |
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. |
Hi I am not sure why I can not get pkg to run when I use getmac as a dependency:
package.json:
{ "name": "getmactest", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "getmac": "^1.4.6" } }
index.js:
// Fetch the computer's mac address require('getmac').getMac(function(err, macAddress){ if (err) throw err console.log(macAddress) })
Error log after
sudo pkg index.js
The text was updated successfully, but these errors were encountered: