ChainSafe/js-libp2p-noise

This library will not build with Node 15

JonathanWilbur opened this issue · 5 comments

If it is not too large of an ask, I'd rather see bcrypto removed from this library, since it seems like it just does everything that crypto already does and because bcrypto is a huge library. If you need web support, Browserify does a reasonably good job at polyfilling crypto IMO.

I was unable to use ipfs-core in my project because of this.

I would be happy to provide more information.

Version Info

Node Version: v15.7.0
NPM Version: 7.4.3
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.18363 N/A Build 18363
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free

Logs

2585 info run bcrypto@5.4.0 install { code: 1, signal: null }
2586 info run ursa-optional@0.10.2 install { code: 0, signal: null }
2587 timing build:run:install:node_modules/ursa-optional Completed in 4418ms
2588 timing reify:rollback:createSparse Completed in 2848ms
2589 timing reify:rollback:retireShallow Completed in 290ms
2590 timing command:install Completed in 24367ms
2591 verbose stack Error: command failed
2591 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
2591 verbose stack     at ChildProcess.emit (node:events:379:20)
2591 verbose stack     at maybeClose (node:internal/child_process:1069:16)
2591 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:300:5)
2592 verbose pkgid bcrypto@5.4.0
2593 verbose cwd C:\Users\Jonathan\Desktop\wildboar\api2.vis.apps.wildboarsoftware.com
2594 verbose Windows_NT 10.0.18363
2595 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "ipfs-core" "-d"
2596 verbose node v15.7.0
2597 verbose npm  v7.4.3
2598 error code 1
2599 error path C:\Users\Jonathan\Desktop\wildboar\api2.vis.apps.wildboarsoftware.com\node_modules\bcrypto
2600 error command failed
2601 error command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
2602 error gyp info it worked if it ends with ok
2602 error gyp info using node-gyp@7.1.2
2602 error gyp info using node@15.12.0 | win32 | x64
2602 error gyp info find Python using Python version 3.7.9 found at "C:\Users\Jonathan\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe"
2602 error gyp info find VS using VS2019 (16.8.30907.101) found at:
2602 error gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
2602 error gyp info find VS run with --verbose for detailed information
2602 error gyp info spawn C:\Users\Jonathan\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe
2602 error gyp info spawn args [
2602 error gyp info spawn args   'C:\\Users\\Jonathan\\Desktop\\wildboar\\api2.vis.apps.wildboarsoftware.com\\node_modules\\node-gyp\\gyp\\gyp_main.py',
2602 error gyp info spawn args   'binding.gyp',
2602 error gyp info spawn args   '-f',
2602 error gyp info spawn args   'msvs',
2602 error gyp info spawn args   '-I',
2602 error gyp info spawn args   'C:\\Users\\Jonathan\\Desktop\\wildboar\\api2.vis.apps.wildboarsoftware.com\\node_modules\\bcrypto\\build\\config.gypi',
2602 error gyp info spawn args   '-I',
2602 error gyp info spawn args   'C:\\Users\\Jonathan\\Desktop\\wildboar\\api2.vis.apps.wildboarsoftware.com\\node_modules\\node-gyp\\addon.gypi',
2602 error gyp info spawn args   '-I',
2602 error gyp info spawn args   'C:\\Users\\Jonathan\\AppData\\Local\\node-gyp\\Cache\\15.12.0\\common.gypi',
2602 error gyp info spawn args   '-Dlibrary=shared_library',
2602 error gyp info spawn args   '-Dvisibility=default',
2602 error gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Jonathan\\AppData\\Local\\node-gyp\\Cache\\15.12.0',
2602 error gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Jonathan\\Desktop\\wildboar\\api2.vis.apps.wildboarsoftware.com\\node_modules\\node-gyp',
2602 error gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Jonathan\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\15.12.0\\\\<(target_arch)\\\\node.lib',
2602 error gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\Jonathan\\Desktop\\wildboar\\api2.vis.apps.wildboarsoftware.com\\node_modules\\bcrypto',
2602 error gyp info spawn args   '-Dnode_engine=v8',
2602 error gyp info spawn args   '--depth=.',
2602 error gyp info spawn args   '--no-parallel',
2602 error gyp info spawn args   '--generator-output',
2602 error gyp info spawn args   'C:\\Users\\Jonathan\\Desktop\\wildboar\\api2.vis.apps.wildboarsoftware.com\\node_modules\\bcrypto\\build',
2602 error gyp info spawn args   '-Goutput_dir=.'
2602 error gyp info spawn args ]
2602 error gyp: C:\Users\Jonathan\AppData\Local\node-gyp\Cache\15.12.0\common.gypi not found (cwd: C:\Users\Jonathan\Desktop\wildboar\api2.vis.apps.wildboarsoftware.com\node_modules\bcrypto) while reading includes of binding.gyp while trying to load binding.gyp
2602 error gyp ERR! configure error
2602 error gyp ERR! stack Error: `gyp` failed with exit code: 1
2602 error gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\Jonathan\Desktop\wildboar\api2.vis.apps.wildboarsoftware.com\node_modules\node-gyp\lib\configure.js:351:16)
2602 error gyp ERR! stack     at ChildProcess.emit (node:events:369:20)
2602 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
2602 error gyp ERR! System Windows_NT 10.0.18363
2602 error gyp ERR! command "C:\\Users\\Jonathan\\Desktop\\wildboar\\api2.vis.apps.wildboarsoftware.com\\node_modules\\node\\bin\\node.exe" "C:\\Users\\Jonathan\\Desktop\\wildboar\\api2.vis.apps.wildboarsoftware.com\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
2602 error gyp ERR! cwd C:\Users\Jonathan\Desktop\wildboar\api2.vis.apps.wildboarsoftware.com\node_modules\bcrypto
2602 error gyp ERR! node -v v15.12.0
2602 error gyp ERR! node-gyp -v v7.1.2
2602 error gyp ERR! not ok
2603 verbose exit 1

This library builds on windows but I think it has issues with node15: https://github.com/NodeFactoryIo/js-libp2p-noise/runs/2146716474?check_suite_focus=true

I'll check if there is bcrypto update that supports node15, I've also opened issue to replace bcrypto: #93

At @fission-suite we're hitting the same issue. We need node 15 for webcrypto support, but we can't build bcrypto with the same node version.

At @fission-suite we're hitting the same issue. We need node 15 for webcrypto support, but we can't build bcrypto with the same node version.

Thanks for reporting! We are currently working on releasing this lib without bcrypto: #98. We hope that will solve all the issues.

Should be available in the next few days :)

Great news @morian!
We should probably nudge protocol labs folks, too, so they'll update their js-libp2p-noise dependency in ipfs-core, right?
It seems like js-ipfs currently doesn't build in node 15.

I'll create an issue :)

Think this is now resolved as we removed bcrypto. I do think you still need node 16+