Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 432669

Summary: [Running the Node build script] in wiki lacks prerequisites (after npm install failure and use of npm update)
Product: [ECD] Orion Reporter: Adrian Aichner <adrian.aichner>
Component: RelengAssignee: Project Inbox <orion.releng-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mamacdon
Version: 6.0   
Target Milestone: 6.0 M1   
Hardware: All   
OS: All   
Whiteboard:

Description Adrian Aichner CLA 2014-04-12 08:36:04 EDT
https://wiki.eclipse.org/Orion/Releng_Builds#Running_the_Node_build_script
correctly states that grunt needs to be installed.

It seems to miss to docuemnt some other prerequisites, but my findings need review so I am not going to change the wiki page, except for referencing this bug.

On my ubuntu 13.10 system I needed to install these to take all the hurdles:

    $ cd ~/git/org.eclipse.orion.client/modules/orionode
    $ sudo npm install -g grunt-cli
    $ npm install grunt-contrib-clean
    $ npm install grunt-contrib-copy
    $ npm install grunt-contrib-requirejs
    $ npm install grunt-string-replace
    $ npm install grunt-simple-mocha
    $ npm install supertest
    $ npm install mocha

After that I got:

    >> webtools/plugins/webToolsPlugin.js

    Running "string-replace:requiremin" (string-replace) task

    Running "string-replace:orionclient" (string-replace) task

    Running "copy:unstage" (copy) task
    Copied 1482 files

    Running "simplemocha:all" (simplemocha) task

      ․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․

      44 passing (3s)


    Done, without errors.
    adrian@apa:~/git/org.eclipse.orion.client/modules/orionode$
Comment 1 Adrian Aichner CLA 2014-04-12 08:47:59 EDT
Also, after
    npm install
I had to do
    npm update
to resolve some errors.

Note that installed tried to install the grunt-contrib-*, mocha, 
but failed early.

The npm update seems to have resolved that issue but missed those prerequisites I just mentioned?

    adrian@apa:~/git/org.eclipse.orion.client/modules/orionode$ npm install
    npm http GET https://registry.npmjs.org/mocha
    npm http GET https://registry.npmjs.org/grunt-contrib-copy
    npm http GET https://registry.npmjs.org/grunt-cli
    npm http GET https://registry.npmjs.org/grunt-contrib-requirejs
    npm http GET https://registry.npmjs.org/grunt-string-replace
    npm http GET https://registry.npmjs.org/grunt-simple-mocha
    npm http GET https://registry.npmjs.org/requirejs
    npm http GET https://registry.npmjs.org/supertest
    npm http GET https://registry.npmjs.org/grunt-contrib-clean
    npm http GET https://registry.npmjs.org/node-inspector
    npm http 304 https://registry.npmjs.org/grunt-contrib-requirejs
    npm http 304 https://registry.npmjs.org/grunt-string-replace
    npm http 304 https://registry.npmjs.org/grunt-simple-mocha
    npm http 304 https://registry.npmjs.org/requirejs
    npm http 304 https://registry.npmjs.org/supertest
    npm http 304 https://registry.npmjs.org/grunt-contrib-clean
    npm http 304 https://registry.npmjs.org/node-inspector
    npm http GET https://registry.npmjs.org/node-inspector/-/node-inspector-0.2.0beta4.tgz
    npm http 200 https://registry.npmjs.org/node-inspector/-/node-inspector-0.2.0beta4.tgz
    npm ERR! Error: invalid version: 0.2.0beta4
    npm ERR!     at validVersion (/usr/lib/nodejs/read-package-json/read-json.js:573:40)
    npm ERR!     at final (/usr/lib/nodejs/read-package-json/read-json.js:323:23)
    npm ERR!     at /usr/lib/nodejs/read-package-json/read-json.js:139:33
    npm ERR!     at cb (/usr/lib/nodejs/slide/lib/async-map.js:48:11)
    npm ERR!     at /usr/lib/nodejs/read-package-json/read-json.js:251:40
    npm ERR!     at fs.js:268:14
    npm ERR!     at /usr/lib/nodejs/graceful-fs/graceful-fs.js:103:5
    npm ERR!     at Object.oncomplete (fs.js:107:15)
    npm ERR! If you need help, you may report this log at:
    npm ERR!     <http://bugs.debian.org/npm>
    npm ERR! or use
    npm ERR!     reportbug --attach /var/home/adrian/git/org.eclipse.orion.client/modules/orionode/npm-debug.log npm

    npm ERR! System Linux 3.11.0-20-generic
    npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
    npm ERR! cwd /var/home/adrian/git/org.eclipse.orion.client/modules/orionode
    npm ERR! node -v v0.10.15
    npm ERR! npm -v 1.2.18
    npm http 304 https://registry.npmjs.org/grunt-contrib-copy
    npm http 304 https://registry.npmjs.org/grunt-cli
    npm http 304 https://registry.npmjs.org/mocha
    npm ERR!
    npm ERR! Additional logging details can be found in:
    npm ERR!     /var/home/adrian/git/org.eclipse.orion.client/modules/orionode/npm-debug.log
    npm ERR! not ok code 0
    adrian@apa:~/git/org.eclipse.orion.client/modules/orionode$ npm update
    npm http GET https://registry.npmjs.org/connect
    npm http GET https://registry.npmjs.org/socket.io
    npm http GET https://registry.npmjs.org/socket.io-client
    npm http GET https://registry.npmjs.org/deferred-fs
    npm http GET https://registry.npmjs.org/rimraf
    npm http GET https://registry.npmjs.org/node-inspector/-/node-inspector-0.2.0beta4.tgz
    npm http 304 https://registry.npmjs.org/socket.io
    npm http 304 https://registry.npmjs.org/socket.io-client
    npm http 200 https://registry.npmjs.org/node-inspector/-/node-inspector-0.2.0beta4.tgz
    npm http GET https://registry.npmjs.org/socket.io-client/0.9.16
    npm http GET https://registry.npmjs.org/policyfile/0.0.4
    npm http GET https://registry.npmjs.org/base64id/0.1.0
    npm http GET https://registry.npmjs.org/redis/0.7.3
    npm http GET https://registry.npmjs.org/uglify-js/1.2.5
    npm http GET https://registry.npmjs.org/ws
    npm http GET https://registry.npmjs.org/xmlhttprequest/1.4.2
    npm http GET https://registry.npmjs.org/active-x-obfuscator/0.0.1
    npm http 304 https://registry.npmjs.org/connect
    npm http GET https://registry.npmjs.org/qs/0.5.1
    npm http GET https://registry.npmjs.org/formidable/1.0.11
    npm http GET https://registry.npmjs.org/crc/0.2.0
    npm http GET https://registry.npmjs.org/cookie/0.0.4
    npm http GET https://registry.npmjs.org/bytes/0.1.0
    npm http GET https://registry.npmjs.org/send/0.0.4
    npm http GET https://registry.npmjs.org/fresh/0.1.0
    npm http GET https://registry.npmjs.org/pause/0.0.1
    npm http GET https://registry.npmjs.org/debug
    npm http 304 https://registry.npmjs.org/policyfile/0.0.4
    npm http 304 https://registry.npmjs.org/deferred-fs
    npm http 304 https://registry.npmjs.org/base64id/0.1.0
    npm http 304 https://registry.npmjs.org/redis/0.7.3
    npm http 304 https://registry.npmjs.org/uglify-js/1.2.5
    npm http 304 https://registry.npmjs.org/socket.io-client/0.9.16
    npm http 304 https://registry.npmjs.org/xmlhttprequest/1.4.2
    npm http 304 https://registry.npmjs.org/ws
    npm http 304 https://registry.npmjs.org/active-x-obfuscator/0.0.1
    npm http 304 https://registry.npmjs.org/qs/0.5.1
    npm http GET https://registry.npmjs.org/zeparser/0.0.5
    npm http GET https://registry.npmjs.org/commander
    npm http GET https://registry.npmjs.org/nan
    npm http GET https://registry.npmjs.org/tinycolor
    npm http GET https://registry.npmjs.org/options
    npm http 304 https://registry.npmjs.org/cookie/0.0.4
    npm http 304 https://registry.npmjs.org/formidable/1.0.11
    npm http 304 https://registry.npmjs.org/crc/0.2.0
    npm http 304 https://registry.npmjs.org/send/0.0.4
    npm http GET https://registry.npmjs.org/mime/1.2.6
    npm http GET https://registry.npmjs.org/range-parser/0.0.4
    npm http 304 https://registry.npmjs.org/fresh/0.1.0
    npm http 304 https://registry.npmjs.org/bytes/0.1.0
    npm http 304 https://registry.npmjs.org/pause/0.0.1
    npm http 304 https://registry.npmjs.org/debug
    npm http 200 https://registry.npmjs.org/rimraf
    npm http GET https://registry.npmjs.org/graceful-fs
    npm http 304 https://registry.npmjs.org/zeparser/0.0.5
    npm http 304 https://registry.npmjs.org/tinycolor
    npm http 304 https://registry.npmjs.org/nan
    npm http 304 https://registry.npmjs.org/options
    npm http 304 https://registry.npmjs.org/mime/1.2.6
    npm http 304 https://registry.npmjs.org/range-parser/0.0.4
    npm http 304 https://registry.npmjs.org/graceful-fs
    npm http 304 https://registry.npmjs.org/commander
    adrian@apa:~/git/org.eclipse.orion.client/modules/orionode$ grunt
    >> Local Npm module "grunt-contrib-clean" not found. Is it installed?
    >> Local Npm module "grunt-contrib-copy" not found. Is it installed?
    >> Local Npm module "grunt-contrib-requirejs" not found. Is it installed?
    >> Local Npm module "grunt-simple-mocha" not found. Is it installed?
    >> Local Npm module "grunt-string-replace" not found. Is it installed?
    Warning: Task "clean" not found. Use --force to continue.

    Aborted due to warnings.
Comment 2 Mark Macdonald CLA 2014-04-12 11:33:40 EDT
This is a bug: the grunt script is only supposed to run before we publish the orion package, not when an 'npm install' is performed from the source repo. Turns out npm calls it in both cases :(
https://github.com/npm/npm/issues/3059

I've released a fix. The next time you npm install from source, the grunt script will not run.
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=0a798360c2e47ed15a815b2e567614a3c9461a92

Install seems to have bombed out before it reached the grunt-contrib-* dependencies because of a failure to install the node-inspector. But I have not been able to reproduce this. We should see if updating the node-inspector version fixes the issue. I added a comment to bug 432107 about this -- follow that bug for more details.