I'm trying to build tidepool from the documentation at http://developer.tidepool.io/starting-up-services/.
I get 3 failures.
During the tools folder get_current_tidepool_repos.sh, I get an error about the versions of node and npm;
During the . tools/runservers I get errors building Blip about packages not found and a legacy binary of node.
This is my 3rd unsuccessful attempt to build Tidepool in a VM. I've found a few things along the way (like npm proxy settings need to be done with the -g flag), but I'm stumped at this point. The last time I got to a set of Blip build errors, I seemed to find myself hand-installing a set of npm dependencies that seemed more and more incorrect, with no success.
Originally I tried installing nodejs instead of nodejs-legacy, which generated other failures about not being able to find node. I went with nodejs-legacy after reading notes about how that package is meant to deal with name issues on Debian systems such as Ubuntu (that on Debian, node is named nodejs).
Any idea what I'm doing wrong? Below are the error messages, and a list of the steps I've done so far. Note: I'm a total newbie on many of the technologies (node, go, npm), so I may be making some newbie mistake.
Thanks,
Brad Needham
Intel Corporation
---------------- errors from running get_current_tidepool_repos.sh
https://registry.npmjs.org/tideline/-/tideline-0.1.22.tgz
npm ERR! 404 'blip-mock-data' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 3.16.0-40-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/brad/Documents/tidepool/blip
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/brad/Documents/tidepool/blip/npm-debug.log
npm ERR! not ok code 0
---------- errors from . tools/runservers
Building Blip...
module.js:340
throw err;
^
Error: Cannot find module 'shelljs/global'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/brad/Documents/tidepool/blip/buildapp.js:2:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
npm ERR! weird error 8
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
npm ERR! weird error 1
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
Starting blip
Started blip, pid 15107
module.js:340
throw err;
^
Error: Cannot find module 'connect'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/brad/Documents/tidepool/blip/server.js:4:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
[13]+ Exit 8 node $2 2>&1 >> ../server.log
------------------------------ my script for creating the vm and installing Tidepool on it.
Create a VM
- Download the Ubuntu 14.04 64-bit desktop .iso file:
o Browse to http://www.ubuntu.com/download/desktop
o Select the 64-bit version and click Download.
- Use VirtualBox (or another VM manager) to create a VM with 2GB Ram, 20GB disk, and 64-bit Ubuntu 14.04 installed.
- Start that VM
- Select the downloaded Ubuntu .iso file to boot from.
- Wait for ubuntu to start.
- Click Install Ubuntu
- Select “install this third-party software”, but do not select “Download updates while installing”, because the proxy isn’t set up yet.
- Continue through the rest of the setup.
- Once it stops, waiting, press Enter (it’s waiting for you to “remove” the install disk.
o Once the VM is restarted and up…
- (VirtualBox only) In the VM border select Devices / Insert guest additions CD image…. This will enable your VM screen to enlarge to something useful. Without this, you won’t be able to set the proxy, or do many other things, because the icons would be off-screen.
- When “Press return to close this window” appears, press Enter
- Scroll down to on the left menu bar to the CD icon, right click on it, and select Eject.
- Try to resize the window by dragging the corner. If the Ubuntu window doesn’t resize, reboot the VM and try again.
- Set the proxies:
o In the system menu (top-right gear icon), select System Settings…
o In the resultant window, click on Network.
o Click Network proxy
o Select Method: Manual and fill in the following proxies:
HTTP: proxy-jf-intel.com port 911
HTTPS same as HTTP
FTP same as HTTP
Socks Host – leave blank for now. XXX find our Socks5 proxy.
o Click Apply system wide
o Test by opening Firefox: it should show Google.
- (VirtualBox only) Turn on VM Client copy/past with the host: select Devices /shared clipboard / bidirectional XXXX that doesn’t seem to work; at least trying to paste into Terminal or Libre Office doesn’t. Wound up using a USB drive to transfer files between host and the VM.
- Because you will need it often, pin a terminal session to the left bar:
o Click the “search your computer…” icon – the top icon in the left bar
o Type terminal
o Drag the resulting Terminal icon to the left bar
- Update the Ubuntu software
o Click the “search your computer…” icon – the top icon in the left bar
o Type Software Updater
o Click on the resulting A-in-a-circle Icon, labeled Software Updater.
o When it offers updates, Click Install Now
o Wait for the update to complete
o Restart as requested.
o In a terminal window, type sudo apt-get update (this updates the package manager’s idea of what packages are where).
Install the Tidepool prerequisites
- Git. In a terminal, type sudo apt-get install git
- (skip for now – haven’t found where it’s needed) Mercurial. In a terminal, type sudo apt-get install mercurial
- Bazaar. In a terminal, type sudo apt-get install bzr
- Node. Open a Terminal. Type sudo apt-get install nodejs-legacy (“legacy” because Ubuntu installs NodeJs under a name other than the standard name, “node”. This package is supposed to fix that issue.)
- Npm. A Javascript (Node) package manager. In a terminal, type sudo apt-get install npm
a. Configure the npm proxy See http://jjasonclark.com/how-to-setup-node-behind-web-proxy/. Type in a terminal:
i. sudo npm config set –g proxy http://proxy-jf.intel.com:911
ii. sudo npm config set –g https-proxy http://proxy-jf.intel.com:911
- Gulp. A streaming build system: sudo npm install --global gulp
- Mocha, a testing framework. Open a terminal. Type sudo npm install –g mocha
- Mongod. The Mongo DB server (daemon). With one exception, follow the instructions at http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/#install-mongodb
• Exception: The first command needs the proxy argument: --keyserver-options http-proxy=http://proxy-jf.intel.com:911
- The Go language. In a terminal window, type sudo apt-get install golang
Pull the source
- Open a terminal window
- Create a home directory for the source and cd to it
- git clone https://github.com/tidepool-org/tools.git (from https://github.com/tidepool-org/tools)
- cd into the resultant tools folder and type: ./get_current_tidepool_repos.sh >~/tidelog 2>&1
- Wait a few minutes until the command completes, then look for errors in the log file (~/tidelog)
a. Got npm ERR! ‘blip-mock-data’ is not in the npm registry. You should but the autor to publish it.
b. Got npm ERR! Node –v v0.10.25; npm ERR! Npm –v 1.3.10
i. Additional logging details can be found in: tidepool/blip/npm-debug.log
Start the server the first time
- In a terminal window,
a. Cd to the folder you created for the Git repos.
b. type (without quotes) “. tools/runservers >mylog.log 2>&1”
- The first run performs a lot of installation, taking about 10 minutes.
a. Building Blip failed.
i. Got an error about missing 'shelljs/global'. The last time I went down this path, I got to a webpack module that seemed to want to be installed both locally and globally.