pkg
pkg copied to clipboard
"Warning cannot find module" (but module is still included)
What version of pkg are you using?
5.7.0
What version of Node.js are you using?
16.14.2
What operating system are you using?
MacOS
What CPU architecture are you using?
x86_64
What Node versions, OSs and CPU architectures are you building for?
node16-macos-x64, node16-linux-x64, node16-win-x64
Describe the Bug
The full warning we get on MacOS (intel) with Node v16.14.2 is:
> Warning Cannot find module '@smartthings/plugin-cli-edge' from '/Users/rossstenersen/dev/cli/smartthings-cli/packages/cli/bin' in /Users/rossstenersen/dev/cli/smartthings-cli/packages/cli/bin/run
I also tested building this on Debian x86_64 with v16.16.0, v16.15.1 and v16.14.2.
I put a bunch of debug in to try to figure out why this was happening and noticed that immediately after this warning is emitted, the pkg
tool starts adding files from the plugin it just warned it couldn't find. It doesn't appear to ever come across the module again. The binary that pkg
builds works properly and does indeed include all the files from the @smartthings/plugin-cli-edge
dependency.
I'm also confused about why it's reporting finding the plugin via the run
command since it's a plugin and there is no specific require via the run command. (i.e. I would expect the package to be found only via the dependency listed in package.json and even thought I would have to include it in the list of assets.)
Expected Behavior
This warning seems superfluous to me but if it's correct, I would like to understand why it is happening so we can fix it or at the very least understand it enough to know if it is safe to ignore.
To Reproduce
- Clone https://github.com/SmartThingsCommunity/smartthings-cli
- run
npm install
- run
npm run build
- run
npm run package
I'm also wondering if this is related to issue #1336. (We don't directly use yarn but it is included because a library we use, oclif, uses it for plugins.)
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.
what's the point of those bots that keep closing issues, why they've been implemented, to begin with? the "reopen" option is not available as well.
same, the executable works correctly