Advanced Bitcoin Scripting - Discussion

the commands I run are npm install --global windows-build-tools in PowerShell as Administrator, then:

npm init
npm install https://github.com/bcoin-org/bcoin

after that I run node address.js
Much like in the video?

Did you get any errors when doing install? I have tried myself and it installed bcoin as expected. You’re missing the library in node modules.

1 Like

hm, I get this error but not sure what I can do about this? maybe manual installation?

npm install https://github.com/bcoin-org/bcoin

> [email protected] install C:\Users\enrique\Documents\Code\multisig\node_modules\bcoin\node_modules\bcrypto
> node-gyp rebuild

C:\Users\enrique\Documents\Code\multisig\node_modules\bcoin\node_modules\bcrypto>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Traceback (most recent call last):
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 47, 
in <module>
    import gyp
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 10, in <module>
    import gyp.input
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 11, in <module>
    import multiprocessing
  File "C:\Python27\Lib\multiprocessing\__init__.py", line 83, in <module>
    import _multiprocessing
ImportError: DLL load failed: %1 is not a valid Win32 application.
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)      
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\enrique\Documents\Code\multisig\node_modules\bcoin\node_modules\bcrypto     
gyp ERR! node -v v14.17.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\enrique\AppData\Roaming\npm-cache\_logs\2021-06-18T16_25_56_296Z-debug.log  

Can you try installing bcoin using the instructions from the repo? Clone the repo in the node modules folder to be able to import libs.

https://github.com/bcoin-org/bcoin#install

yes I actually tried that but it leads to this error messages.
Are there alternatives to node maybe?

C:\Users\enrique\Documents\Code\multisig>cd node_modules

C:\Users\enrique\Documents\Code\multisig\node_modules>git clone git://github.com/bcoin-org/bcoin.git
Cloning into 'bcoin'...
remote: Enumerating objects: 45426, done.
remote: Total 45426 (delta 0), reused 0 (delta 0), pack-reused 45426 eceiving objects: 100% (45426Receiving objects: 100% (454iB/s
26/45426), 30.22 MiB | 24.72 MiB/s, done.
Resolving deltas: 100% (33482/33482), done.

C:\Users\enrique\Documents\Code\multisig\node_modules>cd bcoin

C:\Users\enrique\Documents\Code\multisig\node_modules\bcoin>npm rebuild

> [email protected] install C:\Users\enrique\Documents\Code\multisig\node_modules\bcoin\node_modules\bcrypto
> node-gyp rebuild


C:\Users\enrique\Documents\Code\multisig\node_modules\bcoin\node_modules\bcrypto>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Traceback (most recent call last):
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 47, 
in <module>
    import gyp
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 10, in <module>
    import gyp.input
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 11, in <module>
    import multiprocessing
  File "C:\Python27\Lib\multiprocessing\__init__.py", line 83, in <module>
    import _multiprocessing
ImportError: DLL load failed: %1 is not a valid Win32 application.
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)      
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\enrique\Documents\Code\multisig\node_modules\bcoin\node_modules\bcrypto     
gyp ERR! node -v v14.17.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\enrique\AppData\Roaming\npm-cache\_logs\2021-06-19T13_22_42_541Z-debug.log  

C:\Users\enrique\Documents\Code\multisig\node_modules\bcoin>./bin/bcoin
'.' is not recognized as an internal or external command,
operable program or batch file.

It could be an issue with your node install. You did install the 64bit version of node and have a 64bit version of windows?

Yes 64bit Windows and 64bit NodeJS version. I uninstalled version v14.17.1 and installed v16.3.0 but still the same.

Is there a step by step written instruction somewhere? Maybe doing it like that I can see what I’m doing wrong

I think its best to use the LTS version for node. You can try these instructions that was made by one of our students a while ago: Advanced Bitcoin Scripting - Discussion

1 Like

this means that the environment variable for Python is not properly set and it’s not working because of that? (following the instruction in the post you referenced)

PS C:\Users\enrique\Documents\Code\multisigproject> npm install bcoin
npm ERR! code 1
npm ERR! path C:\Users\enrique\Documents\Code\multisigproject\node_modules\mrmr
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration
npm ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "C:\Python39\"
npm ERR! gyp ERR! find Python - "C:\Python39\" is not in PATH or produced an error
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python2" can be used
npm ERR! gyp ERR! find Python - "python2" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Python27\python.exe
npm ERR! gyp ERR! find Python - "C:\Python27\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:302:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:200:18)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:266:16)
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\enrique\Documents\Code\multisigproject\node_modules\mrmr
npm ERR! gyp ERR! node -v v16.4.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\enrique\AppData\Local\npm-cache\_logs\2021-06-25T13_56_29_458Z-debug.log
PS C:\Users\enrique\Documents\Code\multisigproject> npm config set python "C:\Python39\python.exe"
PS C:\Users\enrique\Documents\Code\multisigproject> npm install bcoin
npm ERR! code 1
npm ERR! path C:\Users\enrique\Documents\Code\multisigproject\node_modules\mrmr
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration
npm ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "C:\Python39\python.exe"
npm ERR! gyp ERR! find Python - "C:\Python39\python.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python2" can be used
npm ERR! gyp ERR! find Python - "python2" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Python27\python.exe
npm ERR! gyp ERR! find Python - "C:\Python27\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:302:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:200:18)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:266:16)
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\enrique\Documents\Code\multisigproject\node_modules\mrmr
npm ERR! gyp ERR! node -v v16.4.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\enrique\AppData\Local\npm-cache\_logs\2021-06-25T13_57_16_055Z-debug.log
PS C:\Users\enrique\Documents\Code\multisigproject> npm config set python "C:\Python39\python.exe"
PS C:\Users\enrique\Documents\Code\multisigproject> npm install bcoin
npm ERR! code 1
npm ERR! path C:\Users\enrique\Documents\Code\multisigproject\node_modules\mrmr
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | x64
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration
npm ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "C:\Python39\python.exe"
npm ERR! gyp ERR! find Python - "C:\Python39\python.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python2" can be used
npm ERR! gyp ERR! find Python - "python2" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Python27\python.exe
npm ERR! gyp ERR! find Python - "C:\Python27\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:302:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:200:18)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:266:16)
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:404:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\enrique\Documents\Code\multisigproject\node_modules\mrmr
npm ERR! gyp ERR! node -v v16.4.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\enrique\AppData\Local\npm-cache\_logs\2021-06-25T13_58_14_195Z-debug.log

Ok so the Python version seems to be recognized now and using the older Node.js version I can install bcoin, but when running npm rebuild I get this error. What does this mean - there seems to be an issue with npm again?

PS C:\Users\enrique\Documents\Code\multisigproject\node_modules> cd bcoin
PS C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin> npm rebuild

> [email protected] install C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules\bcrypto
> node-gyp rebuild


C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules\bcrypto>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Traceback (most recent call last):
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 47, in <module>
    import gyp
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 10, in <module>
    import gyp.input
  File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 11, in <module>
    import multiprocessing
  File "C:\Python27\Lib\multiprocessing\__init__.py", line 83, in <module>
    import _multiprocessing
ImportError: DLL load failed: %1 is not a valid Win32 application.
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules\bcrypto
gyp ERR! node -v v14.17.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\enrique\AppData\Roaming\npm-cache\_logs\2021-06-25T14_22_23_937Z-debug.log

This is the verbose output. It’s very confusing to say the least :man_shrugging:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'rebuild'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 info readInstalled object
5 verbose rebuild path, id [
5 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin',
5 verbose rebuild   '[email protected]'
5 verbose rebuild ]
6 verbose rebuild path, id [
6 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bcfg',
6 verbose rebuild   '[email protected]'
6 verbose rebuild ]
7 verbose rebuild path, id [
7 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bsert',
7 verbose rebuild   '[email protected]'
7 verbose rebuild ]
8 verbose rebuild path, id [
8 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bcrypto',
8 verbose rebuild   '[email protected]'
8 verbose rebuild ]
9 verbose rebuild path, id [
9 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bufio',
9 verbose rebuild   '[email protected]'
9 verbose rebuild ]
10 verbose rebuild path, id [
10 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\loady',
10 verbose rebuild   '[email protected]'
10 verbose rebuild ]
11 verbose rebuild path, id [
11 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\nan',
11 verbose rebuild   '[email protected]'
11 verbose rebuild ]
12 verbose rebuild path, id [
12 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bcurl',
12 verbose rebuild   '[email protected]'
12 verbose rebuild ]
13 verbose rebuild path, id [
13 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\brq',
13 verbose rebuild   '[email protected]'
13 verbose rebuild ]
14 verbose rebuild path, id [
14 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bsock',
14 verbose rebuild   '[email protected]'
14 verbose rebuild ]
15 verbose rebuild path, id [
15 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bdb',
15 verbose rebuild   '[email protected]'
15 verbose rebuild ]
16 verbose rebuild path, id [
16 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bdns',
16 verbose rebuild   '[email protected]'
16 verbose rebuild ]
17 verbose rebuild path, id [
17 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bevent',
17 verbose rebuild   '[email protected]'
17 verbose rebuild ]
18 verbose rebuild path, id [
18 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bfile',
18 verbose rebuild   '[email protected]'
18 verbose rebuild ]
19 verbose rebuild path, id [
19 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bfilter',
19 verbose rebuild   '[email protected]'
19 verbose rebuild ]
20 verbose rebuild path, id [
20 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bheep',
20 verbose rebuild   '[email protected]'
20 verbose rebuild ]
21 verbose rebuild path, id [
21 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bindings',
21 verbose rebuild   '[email protected]'
21 verbose rebuild ]
22 verbose rebuild path, id [
22 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\file-uri-to-path',
22 verbose rebuild   '[email protected]'
22 verbose rebuild ]
23 verbose rebuild path, id [
23 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\binet',
23 verbose rebuild   '[email protected]'
23 verbose rebuild ]
24 verbose rebuild path, id [
24 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bs32',
24 verbose rebuild   '[email protected]'
24 verbose rebuild ]
25 verbose rebuild path, id [
25 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\blgr',
25 verbose rebuild   '[email protected]'
25 verbose rebuild ]
26 verbose rebuild path, id [
26 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\blru',
26 verbose rebuild   '[email protected]'
26 verbose rebuild ]
27 verbose rebuild path, id [
27 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\blst',
27 verbose rebuild   '[email protected]'
27 verbose rebuild ]
28 verbose rebuild path, id [
28 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bmutex',
28 verbose rebuild   '[email protected]'
28 verbose rebuild ]
29 verbose rebuild path, id [
29 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bsocks',
29 verbose rebuild   '[email protected]'
29 verbose rebuild ]
30 verbose rebuild path, id [
30 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\btcp',
30 verbose rebuild   '[email protected]'
30 verbose rebuild ]
31 verbose rebuild path, id [
31 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\buffer-map',
31 verbose rebuild   '[email protected]'
31 verbose rebuild ]
32 verbose rebuild path, id [
32 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bupnp',
32 verbose rebuild   '[email protected]'
32 verbose rebuild ]
33 verbose rebuild path, id [
33 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bval',
33 verbose rebuild   '[email protected]'
33 verbose rebuild ]
34 verbose rebuild path, id [
34 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bweb',
34 verbose rebuild   '[email protected]'
34 verbose rebuild ]
35 verbose rebuild path, id [
35 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\n64',
35 verbose rebuild   '[email protected]'
35 verbose rebuild ]
36 verbose rebuild path, id [
36 verbose rebuild   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bmocha',
36 verbose rebuild   '[email protected]'
36 verbose rebuild ]
37 silly rebuild set [
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bcfg',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bsert',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bcrypto',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bufio',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\loady',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\nan',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bcurl',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\brq',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bsock',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bdb',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bdns',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bevent',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bfile',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bfilter',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bheep',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bindings',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\file-uri-to-path',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\binet',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bs32',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\blgr',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\blru',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\blst',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bmutex',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bsocks',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\btcp',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\buffer-map',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bupnp',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bval',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bweb',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\n64',
37 silly rebuild set   'C:\\Users\\enrique\\Documents\\Code\\multisigproject\\node_modules\\bcoin\\node_modules\\bmocha'
37 silly rebuild set ]
38 info build C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules\bcfg
39 info lifecycle [email protected]~preinstall: [email protected]
40 info linkStuff [email protected]
41 silly linkStuff [email protected] has C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules as its parent node_modules
42 info lifecycle [email protected]~install: [email protected]
43 info lifecycle [email protected]~postinstall: [email protected]
44 info build C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules\bsert
45 info lifecycle [email protected]~preinstall: [email protected]
46 info linkStuff [email protected]
47 silly linkStuff [email protected] has C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules as its parent node_modules
48 info lifecycle [email protected]~install: [email protected]
49 info lifecycle [email protected]~postinstall: [email protected]
50 info build C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules\bcrypto
51 info lifecycle [email protected]~preinstall: [email protected]
52 info linkStuff [email protected]
53 silly linkStuff [email protected] has C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules as its parent node_modules
54 info lifecycle [email protected]~install: [email protected]
55 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle true
56 verbose lifecycle [email protected]~install: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules\bcrypto\node_modules\.bin;C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules\.bin;C:\Users\enrique\Documents\Code\multisigproject\node_modules\.bin;C:\Python39\Scripts\;C:\Python39\;C:\Program Files (x86)\VMware\VMware Player\bin\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Python27;C:\Program Files\PuTTY\;C:\nasmx\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;"C:\Android\sdk\tools;C:\Android\sdk\platform-tools\";C:\Program Files\dotnet\;C:\Program Files\Pandoc\;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Ruby27-x64\bin;C:\Users\enrique\AppData\Local\Microsoft\WindowsApps;C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;C:\Program Files (x86)\Nmap;C:\Users\enrique\AppData\Local\Programs\Microsoft VS Code\bin;C:\python27;C:\Users\enrique\.dotnet\tools;C:\ProgramData\enrique\atom\bin;C:\Users\enrique\AppData\Local\atom\bin;C:\Users\enrique\AppData\Roaming\npm;C:\Python39\python.exe
57 verbose lifecycle [email protected]~install: CWD: C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin\node_modules\bcrypto
58 silly lifecycle [email protected]~install: Args: [ '/d /s /c', 'node-gyp rebuild' ]
59 silly lifecycle [email protected]~install: Returned: code: 1  signal: null
60 info lifecycle [email protected]~install: Failed to exec install script
61 verbose stack Error: [email protected] install: `node-gyp rebuild`
61 verbose stack Exit status 1
61 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
61 verbose stack     at EventEmitter.emit (events.js:375:28)
61 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
61 verbose stack     at ChildProcess.emit (events.js:375:28)
61 verbose stack     at maybeClose (internal/child_process.js:1055:16)
61 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
62 verbose pkgid [email protected]
63 verbose cwd C:\Users\enrique\Documents\Code\multisigproject\node_modules\bcoin
64 verbose Windows_NT 10.0.19042
65 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "rebuild"
66 verbose node v14.17.1
67 verbose npm  v6.14.13
68 error code ELIFECYCLE
69 error errno 1
70 error [email protected] install: `node-gyp rebuild`
70 error Exit status 1
71 error Failed at the [email protected] install script.
71 error This is probably not a problem with npm. There is likely additional logging output above.
72 verbose exit [ 1, true ]

when using Ubuntu it seems to install bcoin properly but instead glibc 2.28 is not found, when installing glibc from source it’s 2.31 which is not backward compatible. This is what happens on Ubuntu:
image

You have to install build essentials, you don’t have to compile it from source. You can do this by running apt install build-essential

1 Like

hm not sure I seem to be getting the same error even after running that?
somehow the binding doesn’t work
image

Try removing the node_modules folder and package-lock.json and reinstalling bcoin after you installed the package. I tried bcoin on Arch and Ubuntu and worked fine with both systems.

1 Like

it’s not working, I did as you suggested and followed this order here Advanced Bitcoin Scripting - Discussion and yet it doesn’t work.
Should I set up a new VM and start over from scratch?
Why is it so difficult to find the mistake if it’s supposed to be a simple task?

hallelujah it’s finally working, Alko89 thank you so much for your patience and support, thanks a lot really appreciate!

Hey, glad you made it work :raised_hands: bcoin has issues often, not sure why its so sensitive. Can you tell me what you did to make it work?

1 Like

just as indicated, but I reinstalled a new Ubuntu 20.04 on VMWare and ran

sudo apt install build-essential
mkdir multisig_project
multisig_project
sudo apt install npm
npm init
npm instal bcoin
touch address.js
sudo apt install vim
vim address.js 
node address.js

I used vim instead of Sublime but that pretty much made it work

It shouldn’t matter what text editor you use. You might have broken something when trying to use a custom version of glibc instead of the one provided in the OS repos. This library is quite essential and requires to be the proper version for the system to function properly.
Its installed by default but Ubuntu doesn’t have the dev headers installed for most packages by default (you notice this by the *-dev or *-source in the package name). By installing it yourself you might have gotten a missmatch between those…just a guess though :sweat_smile:

1 Like

I am running into issues here trying to install bcoin

npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://github.com/bcoin-org/bcoin.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kevin\AppData\Roaming\npm-cache\_logs\2021-07-07T14_35_14_600Z-debug.log

:thinking: