airbnb / airpal

Web UI for PrestoDB.
http://airbnb.github.io/airpal
Apache License 2.0
2.76k stars 457 forks source link

buildAssets fails #112

Open grepwood opened 9 years ago

grepwood commented 9 years ago

I'm trying to install airpal from scratch on Debian Wheezy with nodejs on it. Here is the build log from the command ./gradlew clean shadowJar -Dairpal.useLocalNode:

:installAssets
npm WARN unmet dependency /root/airpal/src/main/resources/assets/node_modules/babel-jest/node_modules/babel-core requires lodash@'^3.2.0' but will load
npm WARN unmet dependency /root/airpal/src/main/resources/assets/node_modules/lodash,
npm WARN unmet dependency which is version 2.4.2
npm WARN unmet dependency /root/airpal/src/main/resources/assets/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws requires commander@'~0.6.1' but will load
npm WARN unmet dependency /root/airpal/src/main/resources/assets/node_modules/browser-sync/node_modules/commander,
npm WARN unmet dependency which is version 2.3.0
:buildAssets

TypeError: Cannot read property 'prototype' of undefined
    at Object.exports.inherits (util.js:556:43)
    at Object.<anonymous> (/root/airpal/src/main/resources/assets/node_modules/browser-sync/node_modules/http-proxy/lib/http-proxy/index.js:108:17)
    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 Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/root/airpal/src/main/resources/assets/node_modules/browser-sync/node_modules/http-proxy/lib/http-proxy.js:4:17)
    at Module._compile (module.js:456:26)
:buildAssets FAILED

I noticed that :installAssets is pulling these 2 dependencies from the airpal source tree rather than from the system, which causes warns. Versions available through npm are newer.

grepwood commented 9 years ago

This problem also occurs on RHEL 6.4

susman commented 9 years ago

Ubuntu 14.04.2 as well

andykram commented 9 years ago

It should run an npm install which is why it looks local. What version of node do you have installed locally (should be available via node -v)? The version Airpal will use by default (pull and vendor, not look for on the local system) are listed in the build.gradle. Have you tried building without -Dairpal.useLocalNode?

grepwood commented 9 years ago

node -v prints v0.10.29. Almost the same thing is happening without -Dairpal.useLocalNode.

:cleanAssets UP-TO-DATE
:clean UP-TO-DATE
:nodeSetup UP-TO-DATE
:installAssets
:buildAssets

TypeError: Cannot read property 'prototype' of undefined
    at Object.exports.inherits (util.js:556:43)
    at Object.<anonymous> (/root/airpal/src/main/resources/assets/node_modules/browser-sync/node_modules/http-proxy/lib/http-proxy/index.js:108:17)
    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 Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/root/airpal/src/main/resources/assets/node_modules/browser-sync/node_modules/http-proxy/lib/http-proxy.js:4:17)
    at Module._compile (module.js:456:26)
:buildAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildAssets'.
> Process 'command '/root/.gradle/nodejs/node-v0.10.33-linux-x64/bin/node'' finished with non-zero exit value 8

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7.149 secs

This is also happening on Debian Jessie.

schmilblick commented 9 years ago

+1, getting the same error on OS X

Paxa commented 9 years ago

Also have it on OS X

node -v
v0.12.3
npm -v
2.9.1
waltonryan commented 9 years ago

This worked for me: https://github.com/airbnb/airpal/issues/111

Possible fix: edit src/main/resources/assets/package.json and change browser-sync to ~2.6.5

susman commented 9 years ago

upgrading browser sync to ~2.6.5 worked for me as well, then it won't compile against current presto versions: https://github.com/airbnb/airpal/issues/99 Once compiled for 0.77 ( default ) - works with newer presto versions

grepwood commented 9 years ago

Builds successfuly on Debian Jessie and RHEL 6.4 after applying @waltonryan 's fix.

tristanwietsma commented 9 years ago

Changing browser sync to ~2.6.5 got me further into the build, but then got a new failure:

:installAssets

> ws@0.5.0 install /airpal/src/main/resources/assets/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

> contextify@0.1.14 install /airpal/src/main/resources/assets/node_modules/jest-cli/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at F (/root/.gradle/nodejs/node-v0.10.33-linux-x64/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack     at E (/root/.gradle/nodejs/node-v0.10.33-linux-x64/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack     at /root/.gradle/nodejs/node-v0.10.33-linux-x64/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack     at Object.oncomplete (evalmachine.<anonymous>:107:15)
gyp ERR! System Linux 3.18.5-tinycore64
gyp ERR! command "node" "/root/.gradle/nodejs/node-v0.10.33-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /airpal/src/main/resources/assets/node_modules/jest-cli/node_modules/jsdom/node_modules/contextify
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok 

> ws@0.4.31 install /airpal/src/main/resources/assets/node_modules/browser-sync/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)

npm ERR! contextify@0.1.14 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the contextify@0.1.14 install script.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.18.5-tinycore64
npm ERR! command "/root/.gradle/nodejs/node-v0.10.33-linux-x64/bin/node" "/root/.gradle/nodejs/node-v0.10.33-linux-x64/lib/node_modules/npm/bin/npm-cli.js" "install"
npm ERR! cwd /airpal/src/main/resources/assets
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
:installAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':installAssets'.
> Process 'command '/root/.gradle/nodejs/node-v0.10.33-linux-x64/bin/node'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Dockerfile and modified package.json at https://github.com/tristanwietsma/docker-airpal

grepwood commented 9 years ago

@tristanwietsma try with --stacktrace. It could tell you more about this failure. In my case, I found out this way that you need a Java compiler for a different fault that I didn't describe here.

Paxa commented 9 years ago

You also can compile on your laptop/localhost and copy to server. Works for both assets and java files

xushuo commented 8 years ago

@tristanwietsma I had the same error ,How did you solved the above problems? image

sangDev commented 7 years ago

When I run this: ./gradlew clean shadowJar -Dairpal.useLocalNode I get the same error even after updating Changing browser sync to ~2.6.5 as shown below.

builderror

Anyone got an idea?

leemengtw commented 6 years ago

Got some error today, no hint to solve :/