Closed climaxx closed 6 years ago
I implemented the populateLedgerAccounts method with async. In case it helps, the versions I'm using are:
$ npm -v
5.3.0
$ node -v
v8.4.0
Have you tried installing the ark-client as it says in the repo ?
So the problem is that there are a lot of old mentions to node versions < 7.x (when async was introduced). For example the Vagrantfile suggests using 6.9.1, which won't work.
Now, as mentioned, there are multiple errors, depending on what node version you are running and what repo version:
If you just try and run the latest version of the code and the lastest version of node - such as 8.7.0 - then I get a weird permission denied when using sudo (on Ubuntu)
`
sol@z~$ sudo npm install -g arkecosystem/ark-client#master npm ERR! code 1 npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git://github.com/arkecosystem/ark-client.git /home/sol/.npm/_cacache/tmp/git-clone-9ad54991 npm ERR! /home/sol/.npm/_cacache/tmp/git-clone-9ad54991/.git: Permission denied npm ERR!
npm ERR! A complete log of this run can be found in: npm ERR! /home/sol/.npm/_logs/2017-10-23T11_16_06_726Z-debug.log `
Thanks!
Sorry @climaxx, I will give this a try soon. I missed your response!
@climaxx - it worked for me without doing anything special (I am running on Windows with MINGW64) - see below.
Can you just run node index.js
in the root of the directory, after npm install
?
alexj@Alex-Laptop MINGW64 ~/projects/ark-client (master)
$ npm install -g arkecosystem/ark-client#master
C:\Users\alexj\AppData\Roaming\npm\ark-client -> C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\index.js
> node-hid@0.5.4 install C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid
> node-pre-gyp install --fallback-to-build
node-pre-gyp info it worked if it ends with ok
node-pre-gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
node-pre-gyp verb cli 'C:\\Users\\alexj\\AppData\\Roaming\\npm\\node_modules\\ark-client\\node_modules\\node-hid\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp',
node-pre-gyp verb cli 'install',
node-pre-gyp verb cli '--fallback-to-build' ]
node-pre-gyp info using node-pre-gyp@0.6.31
node-pre-gyp info using node@8.4.0 | win32 | x64
node-pre-gyp verb command install []
node-pre-gyp info check checked for "C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release\HID.node" (not found)
node-pre-gyp http GET https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v57-win32-x64.tar.gz
node-pre-gyp http 404 https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v57-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for node-hid@0.5.4 and node@8.4.0 (node-v57 ABI) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://github.com/node-hid/node-hid/releases/download/0.5.4/HID-v0.5.4-node-v57-win32-x64.tar.gz
node-pre-gyp verb command build [ 'rebuild' ]
C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" clean ) else (node "" clean )
C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure --fallback-to-build --module=C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release\HID.node --module_name=HID --module_path=C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release --python=C:\Users\alexj\.windows-build-tools\python27\python.exe --msvs_version=2015 ) else (node "" configure --fallback-to-build --module=C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release\HID.node --module_name=HID --module_path=C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release --python=C:\Users\alexj\.windows-build-tools\python27\python.exe --msvs_version=2015 )
C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" build --fallback-to-build --module=C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release\HID.node --module_name=HID --module_path=C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release ) else (node "" build --fallback-to-build --module=C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release\HID.node --module_name=HID --module_path=C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
hid.c
win_delay_load_hook.cc
hidapi.vcxproj -> C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release\\hidapi.lib
HID.cc
win_delay_load_hook.cc
..\src\HID.cc(69): warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
..\src\HID.cc(72): warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
..\src\HID.cc(154): warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
..\src\HID.cc(165): warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
..\src\HID.cc(209): warning C4996: 'v8::Function::NewInstance': was declared deprecated [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
C:\Users\alexj\.node-gyp\8.4.0\include\node\v8.h(3788): note: see declaration of 'v8::Function::NewInstance'
..\src\HID.cc(296): warning C4996: 'v8::Value::ToUint32': was declared deprecated [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
C:\Users\alexj\.node-gyp\8.4.0\include\node\v8.h(9608): note: see declaration of 'v8::Value::ToUint32'
..\src\HID.cc(316): warning C4996: 'v8::Value::ToUint32': was declared deprecated [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
C:\Users\alexj\.node-gyp\8.4.0\include\node\v8.h(9608): note: see declaration of 'v8::Value::ToUint32'
..\src\HID.cc(320): warning C4996: 'v8::Value::ToUint32': was declared deprecated [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
C:\Users\alexj\.node-gyp\8.4.0\include\node\v8.h(9608): note: see declaration of 'v8::Value::ToUint32'
..\src\HID.cc(322): warning C4996: 'v8::Value::ToUint32': was declared deprecated [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
C:\Users\alexj\.node-gyp\8.4.0\include\node\v8.h(9608): note: see declaration of 'v8::Value::ToUint32'
..\src\HID.cc(395): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
..\src\HID.cc(485): warning C4244: 'argument': conversion from 'wchar_t' to 'char', possible loss of data [C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\HID.vcxproj]
Creating library C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release\HID.lib and object C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release\HID.exp
Generating code
Finished generating code
HID.vcxproj -> C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release\\HID.node
HID.vcxproj -> C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\node-hid\build\Release\HID.pdb (Full PDB)
node-pre-gyp info ok
> secp256k1@3.3.0 install C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\secp256k1
> prebuild-install || node-gyp rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used."
prebuild-install info begin Prebuild-install version 2.3.0
prebuild-install info looking for local prebuild @ prebuilds\secp256k1-v3.3.0-node-v57-win32-x64.tar.gz
prebuild-install info looking for cached prebuild @ C:\Users\alexj\AppData\Roaming\npm-cache\_prebuilds\https-github.com-cryptocoinjs-secp256k1-node-releases-download-v3.3.0-secp256k1-v3.3.0-node-v57-win32-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ C:\Users\alexj\AppData\Roaming\npm-cache\_prebuilds\https-github.com-cryptocoinjs-secp256k1-node-releases-download-v3.3.0-secp256k1-v3.3.0-node-v57-win32-x64.tar.gz
prebuild-install info unpack resolved to C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\secp256k1\build\Release\secp256k1.node
prebuild-install info unpack required C:\Users\alexj\AppData\Roaming\npm\node_modules\ark-client\node_modules\secp256k1\build\Release\secp256k1.node successfully
prebuild-install info install Successfully installed prebuilt binary!
+ ark-client@1.0.0
added 418 packages in 112.859s
alexj@Alex-Laptop MINGW64 ~/projects/ark-client (master)
$ ark-client
___ __ _________ __
/ | _____/ /__ / ____/ (_)__ ____ / /_
/ /| | / ___/ //_/ / / / / / _ \/ __ \/ __/
/ ___ |/ / / ,< / /___/ / / __/ / / / /_
/_/ |_/_/ /_/|_| \____/_/_/\___/_/ /_/\__/
ark> help
Commands:
help [command...] Provides help for a given command.
exit Exits application.
connect <network> Connect to network. Network is devnet or mainnet
connect node <url> Connect to a server. For example "connect node 5.39.9.251:4000"
disconnect Disconnect from server or network
network stats Get stats from network
account status <address> Get account status
account vote <name> Vote for delegate <name>. Remove previous vote if needed
account unvote Remove previous vote
account send <amount> <address> Send <amount> ark to <address>. <amount> format examples: 10, USD10.4, EUR100
account delegate <username> Register new delegate with <username>
account create Generate a new random cold account
account vanity <string> Generate an address containing lowercased <string> (WARNING you could wait for long)
message sign <message> Sign a message
message verify <message> <publickey> Verify the <message> signed by the owner of <publickey> (you will be prompted to provide the signature)
shARK No you don't want to use this command
ark> connect node 92.222.216.118:4001
Connected to network 6e84d08bd299ed97c212c886c98a57e36545c8f5d645ca7eeae63a8bd62d8988 (mainnet)
ark 92.222.216.118:4001> { nethash: '6e84d08bd299ed97c212c886c98a57e36545c8f5d645ca7eeae63a8bd62d8988',
token: 'ARK',
symbol: 'Ѧ',
explorer: 'https://explorer.ark.io',
version: 23 }
Node height 2413213
ark 92.222.216.118:4001>
Oh, do you want to post the Log file too?
Hello,
Sorry, I had to get hold of the laptop I was using, in order to have that information.
So first of all, I cannot install the ark-client package using npm install - as mentioned previously - I get the same error and you should have seen the logs - some weird permission problem (even if I run as with sudo or change the ownership of the directory that triggers the error).
Secondly, if I try to download the zip file and then run npm install (because otherwise it complains about missing dependencies) - I still get a crash - I will attach the file. 2017-11-10T21_36_06_539Z-debug.log Basically, it fails under node-pre-gyp install --fallback-to-build And of course, node index.js won't work since the process failed.
I am using node version 8.7.0, npm v5.5.1 and Ubuntu 16.04.2 Thanks.
@climaxx is it possible to use https instead of git during npm install?
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git://github.com/arkecosystem/ark-client.git /home/sol/.npm/_cacache/tmp/git-clone-9ad54991
Can confirm ... it does not install on new versions anymore.
PS C:\Users\Jarunik> node -v v8.9.1 PS C:\Users\Jarunik> npm -v 5.5.1
CMD output: ark-client-cmd.txt
Complete Log: 2017-11-11T12_21_04_836Z-debug.log
You both seem to have the same errors. It looks to me like a node-hid issue. I'll investigate when I'm on the computer next 🤔
@Jarunik - I don't know if it's related but your ark-client-cmd.txt file is showing the below:
ack Error: Can't find Python executable "C:\Users\Jarunik\AppData\Local\Programs\Python\Python36-32\python.EXE", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
You may need to confirm python is installed and in the path specified above.
Still looking but if you could fix Python to see if that helped, that would be great! Thanks!
@climaxx I'm still trying to replicate your issue. Would you mind going to the below link to determine if it resolves the issue for you please:
https://docs.npmjs.com/getting-started/fixing-npm-permissions
Thanks!
Updated python and python is installed in that directory.
I had ark-client running before. Just broke when i tried to update to the newer version.
Weird @Jarunik. Your versions aren't vastly different to mine (same major version for node and npm). I wonder if it's a node-hid caching issue (cached on mine), hence why it's not an issue for me. I'll try clearing my cache and trying again
@climaxx you mention a vagrantfile but there isn't one included with the ark-client. What vagrantfile are you using?
@Jarunik and @climaxx i'm in the process of setting up a fresh test environment to try to replicate. I have a couple of questions:
Guys, problem was solved by:
installing python 2.7 adding node & python paths to PATH environmental variable optional SET PYTHON=
before running npm install node-hid
@Jarunik @climaxx - just stumbled upon this for ark-desktop. Maybe it's of use:
I don't have the problem anymore with the current state.
I don't think we're supposed to be using sudo
for things like building/installing apps.
It usually causes permissions issues and build errors.
May be worth trying the following:
Find the path to npm's directory:
npm config get prefix
For many systems, this will be /usr/local
.
WARNING: If the displayed path is just
/usr
, switch to Option 2 or you will mess up your permissions.
Change the owner of npm's directories to the name of the current user (your username!):
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
lib/node_modules
, bin
, and share
).To be honest I'm going to close this as no longer an issue for @Jarunik and no reply from @climaxx.
Thanks for your suggestions @sleepdefic1t and for confirming @Jarunik. Climaxx can reopen the issue if none of the suggestions help.
:+1:
I have tried to pull previous versions of the ark-client and also use the n utility to switch between node versions. I have identified at what version this problem occurs (see below). Also, this happens because before node version 7.6.0 there is no async attribute. But switching node versions will trigger a HID module core dump. Also, this happens in the Vagrant file as well - that has Node version 6.9.1 and you cannot install ark-client on that machine. Last version of Node (8.7.0) with the last version of ark-client has other incompatibilities (which aren't pictured below).