Closed cwalther closed 4 years ago
Thanks for the excellent investigation!
Hmm I think the .idea folder thing is a yarn bug, it shows up in yarn pack
but not npm pack
. I'll switch back to .npmignore
if that works, otherwise I guess I'm going to have to remember to use npm publish
😕.
Given that we're windows-only and N-API, we have a small, closed set of builds that are valid, ideally just the 32 and 64-bit builds, but I don't really like that the fallback doesn't work. Easy enough to add the 32 bit build for now, 60kB is not much in comparison to other packages, and just disable the post-install. If anyone wants something else (electron builds? They already have a tray API though)
Just published v0.3.1 with included 32-bit build - let me know if it works for you!
Unfortunately not, on both architectures:
X:\node64test>npm install native-reg
> native-reg@0.3.1 install X:\node64test\node_modules\native-reg
> using prebuildify
'using' is not recognized as an internal or external command,
operable program or batch file.
npm WARN enoent ENOENT: no such file or directory, open 'X:\node64test\package.json'
npm WARN node64test No description
npm WARN node64test No repository field.
npm WARN node64test No README data
npm WARN node64test No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! native-reg@0.3.1 install: `using prebuildify`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the native-reg@0.3.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Walther\AppData\Roaming\npm-cache\_logs\2019-12-06T10_39_24_696Z-debug.log
Does that “using” mean anything to yarn or to a newer npm? It works for me when I just remove the "install": "using prebuildify",
line.
🤦♂️
Not having an install step would mean it would ignore the prebuilds and try build anyway, in my previous experience, but that seems to be version dependent. so I've used "install": "echo using prebuilds"
, just to disable the default, in the past. Missed the echo
in that build.
I should not be publishing code at 11PM 😴
Just doing some last testing to make sure It's not broken again...
Ok, v0.3.2 should have this fixed for realsies now. 🤞
It seems from my testing npm checks gypfiles: false
is set, but yarn ignores that, and will run node-gyp build
unless scripts.install
is set to a non-empty command. The simplest option is to just echo something sensible.
Ah, makes sense.
Yep, working fine now. Thanks, goodnight and have a nice weekend!
Trying to install release 0.3.0 from npm with node-v8.16.2-win-x86 (for which no prebuild is included) fails with
Error: Cannot find module 'node-addon-api'
.Log
``` X:\node32test>node --version v8.16.2 X:\node32test>node -e console.log(process.arch) ia32 X:\node32test>npm --version 6.12.0 X:\node32test>npm install native-reg s\.staging\node-gyp-build-db3562f8 (1407ms) > native-reg@0.3.0 install X:\node32test\node_modules\native-reg > node-gyp-build X:\node32test\node_modules\native-reg>if not defined npm_config_node_gyp (node "node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) module.js:550 throw err; ^ Error: Cannot find module 'node-addon-api' at Function.Module._resolveFilename (module.js:548:15) at Function.Module._load (module.js:475:25) at Module.require (module.js:597:17) at require (internal/module.js:11:18) at [eval]:1:1 at ContextifyScript.Script.runInThisContext (vm.js:50:33) at Object.runInThisContext (vm.js:139:38) at Object.I can fix that by moving
node-addon-api
fromdevDependencies
todependencies
in package.json. It’s a bit of a shame to have another megabyte of dependencies that is not needed in all cases, but at least it doesn’t have any subdependencies.In addition, the following change would prebuild binaries for both 32- and 64-bit runtimes. It restricts development to environments that have compilers for both of these architectures though, so I leave it up to you whether that is worth it. (And it increases the package size by 60 kB.)
By the way, I notice that the 0.3.0 tarball on npm includes the
.idea
folder, even though it is not mentioned infiles
in package.json. Any idea what happened there?