In a new deployed environment with nodejs 8.1.0 and 8.1.1, starting zenbot with or without arguments involve in a throw error on module.js
module.js:487
throw err;
^
Error: Cannot find module 'options'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/gecko/zenbot/node_modules/gdax/node_modules/ws/lib/WebSocket.js:16:15)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/gecko/zenbot/node_modules/gdax/node_modules/ws/index.js:9:27)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/gecko/zenbot/node_modules/gdax/lib/clients/websocket.js:2:17)
at Module._compile (module.js:569:30)
On Ubuntu 17.04 x64, mongodb 3.2.11-2
did you run;
Obviously i did
npm install yourMissingDependency ?
Also, set the node path?
gecko@gecko-virtual-machine:~$ git clone https://github.com/carlos8f/zenbot.git
Cloning into 'zenbot'...
remote: Counting objects: 7962, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7962 (delta 2), reused 8 (delta 2), pack-reused 7953
Receiving objects: 100% (7962/7962), 6.19 MiB | 915.00 KiB/s, done.
Resolving deltas: 100% (5080/5080), done.
gecko@gecko-virtual-machine:~$ cd zenbot/
gecko@gecko-virtual-machine:~/zenbot$ cp conf-sample.js conf.js
gecko@gecko-virtual-machine:~/zenbot$ npm install
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
added 299 packages in 25.989s
gecko@gecko-virtual-machine:~/zenbot$ sudo chown gecko /usr/lib/node_modules/
gecko@gecko-virtual-machine:~/zenbot$ npm link
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
removed 3 packages and updated 52 packages in 9.364s
/usr/bin/zenbot -> /usr/lib/node_modules/zenbot4/zenbot.sh
/usr/lib/node_modules/zenbot4 -> /home/gecko/zenbot
gecko@gecko-virtual-machine:~/zenbot$ zenbot
module.js:487
throw err;
^
Error: Cannot find module 'options'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/gecko/zenbot/node_modules/gdax/node_modules/ws/lib/WebSocket.js:16:15)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/gecko/zenbot/node_modules/gdax/node_modules/ws/index.js:9:27)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/gecko/zenbot/node_modules/gdax/lib/clients/websocket.js:2:17)
at Module._compile (module.js:569:30)
gecko@gecko-virtual-machine:~/zenbot$
gecko@gecko-virtual-machine:~/zenbot$ printenv
CLUTTER_IM_MODULE=xim
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
LC_MEASUREMENT=it_IT.UTF-8
LESSCLOSE=/usr/bin/lesspipe %s %s
LC_PAPER=it_IT.UTF-8
LC_MONETARY=it_IT.UTF-8
XDG_MENU_PREFIX=gnome-
LANG=en_US.UTF-8
GDM_LANG=en_US
MANAGERPID=1186
DISPLAY=:0
INVOCATION_ID=e3dd66cc16f34e31b7877c42acc28e1e
NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
COMPIZ_CONFIG_PROFILE=ubuntu
GTK2_MODULES=overlay-scrollbar
COLORTERM=truecolor
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
LC_NAME=it_IT.UTF-8
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/gecko
USER=gecko
DESKTOP_SESSION=ubuntu
QT4_IM_MODULE=xim
PWD=/home/gecko/zenbot
HOME=/home/gecko
JOURNAL_STREAM=8:23993
QT_ACCESSIBILITY=1
XDG_SESSION_TYPE=x11
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_SESSION_DESKTOP=ubuntu
LC_ADDRESS=it_IT.UTF-8
SSH_AGENT_LAUNCHER=gnome-keyring
LC_NUMERIC=it_IT.UTF-8
GTK_MODULES=gail:atk-bridge:unity-gtk-module
GNOME_SESSION_XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
TERM=xterm-256color
SHELL=/bin/bash
VTE_VERSION=4402
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus
IM_CONFIG_PHASE=1
XDG_CURRENT_DESKTOP=Unity:Unity7
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
SHLVL=2
LANGUAGE=en_US
WINDOWID=16777222
LC_TELEPHONE=it_IT.UTF-8
GDMSESSION=ubuntu
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=gecko
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/home/gecko/.Xauthority
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
LC_IDENTIFICATION=it_IT.UTF-8
SESSION_MANAGER=local/gecko-virtual-machine:@/tmp/.ICE-unix/1470,unix/gecko-virtual-machine:/tmp/.ICE-unix/1470
LESSOPEN=| /usr/bin/lesspipe %s
GTK_IM_MODULE=ibus
LC_TIME=it_IT.UTF-8
_=/usr/bin/printenv
OLDPWD=/home/gecko
gecko@gecko-virtual-machine:~/zenbot$
CreativeBacon don't scratch your head, with node 6.11 all work seamlessly
i don't see anything in 8.1.1 change log that would break it, looks like the error is coming from gdax module and gdax hasn't been updated for 22 days so i don't think gdax is the problem. try removing node_modules package lock file and run npm install one more time just to make sure everything installs correctly
8.1.1 not work, v6.11.0 work
install node v6.11.0 and bee happy!
Did you see an error while running npm install?
@DeviaVir npm install run without a problem, only shows two warning at the end that you can see in console output that i've pasted up in the page. If i run npm link command with normal user yes, it put out an error, acces denied in /var/lib/node_modules/. If you read the logs that i've write before, you see that i have to chown to the user the directory.. After that the command goes well.
For information of all the readers, DeviaVir have asked me to open this issue. I have no problem since i've installed node 6.11 and living happy with it. Since he have implemented a node version control in the installer i've told him about this problem
Steps to replicate this issue:
1 install whathever virtual machine you like
2download ubuntu desktop 17.04
3 install it in virtual machine
4 do sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt-get autoremove
5 install vm tools and mongodb, (if you use vmware do sudo apt-get install open-vm-tools, if you use another vm read the docs) for mongodb do sudo apt-get install mongodb, it will install ver 3.2.11-2
6 install nodejs ver 8.x from nodejs foundation (if you install nodejs with official ubuntu repository it will install an old ver 4.7.2) do curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - and finally sudo apt-get install -y nodejs
7 clone zenbot in your home directory, do cd ~ and git clone https://github.com/carlos8f/zenbot.git
8 install zenbot, do cd ~, cd zenbot, cp conf-sample.js conf.js, npm install
Since there all goes well.
If you do npm link it put an error because it have to write in /var/lib/node_modules but is writable only by root. If you do sudo it put an error (i think it is some sort of security isolation that prevent node to run with root privileges, this thing in not present in 6.11) so you have to sudo chown <username> /var/lib/node_modules.
After that you can do npm link finally.
Now zenboot seems installed and linked, try to do zenbot and it put an error and don't start.
If you want a working environment, simply exchange curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - with curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - and follow the same steps and all magically work perfectly
Running node 8.1.2, fixed with npm install options async.
root@eea5ba73fd1d:/zenbot# zenbot trade --paper
module.js:487
throw err;
^
Error: Cannot find module 'async'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/zenbot/node_modules/gdax/lib/clients/authenticated.js:3:13)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/zenbot/node_modules/gdax/index.js:3:27)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/zenbot/extensions/exchanges/gdax/exchange.js:1:74)
at Module._compile (module.js:569:30)
```root@eea5ba73fd1d:/zenbot# npm install options async
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm http fetch GET 200 https://registry.npmjs.org/async 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/options 16ms (from cache)
npm info lifecycle [email protected]~preuninstall: [email protected]
npm info lifecycle [email protected]~uninstall: [email protected]
npm info lifecycle [email protected]~postuninstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN [email protected] No repository field.
npm WARN [email protected] No license field.
root@eea5ba73fd1d:/zenbot# node -v
v8.1.2
root@eea5ba73fd1d:/zenbot# zenbot trade --paper
fetching pre-roll data:
skipping 3 hrs of previously collected data
...
```
Looks like it's not listed in gdax package https://github.com/coinbase/gdax-node/blob/master/package.json
Closing due to inactivity.