Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Failure on Ubuntu 14.04 #32

Open
bluepeach opened this issue Sep 25, 2017 · 9 comments
Open

Build Failure on Ubuntu 14.04 #32

bluepeach opened this issue Sep 25, 2017 · 9 comments

Comments

@bluepeach
Copy link

I'm trying to build gerritstats by following the readme on ubuntu 14.04.

It first complained that npm wasn't installed, so I apt-get'ed it.

It then complained that node wasn't installed, so I apt-get'ed it too

It then fails with:

npm http GET https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/block-stream

[email protected] install /home/rschmitt/git/gerritstats/GerritStats/node_modules/node-sass
node scripts/install.js

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! weird error 1
npm ERR! not ok code 0
:GerritStats:npmInstall FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':GerritStats:npmInstall'.

Process 'command 'npm'' finished with non-zero exit value 1

It might be due to legacy node, since it says it's replaced with nodejs. But nodejs is installed. So, I don't know. Does any of this sound familiar?

Rich

@holmari
Copy link
Owner

holmari commented Sep 25, 2017

I don't know if this helps since I don't have Ubuntu 14.04, but check this out:
https://stackoverflow.com/questions/21168141/cannot-install-packages-using-node-package-manager-in-ubuntu

@bluepeach
Copy link
Author

Thanks for your reply, and it looked promising. Unfortunately, there are other compatibility issues too. The next one we run into is:

const Hoek = require('hoek');
^^^^^
SyntaxError: Use of const in strict mode.

Looking around on the web, it seems this might be out of joi and the maintainer says he doesn't support legacy anymore.

Are there plans to support nodejs directly?

@bluepeach
Copy link
Author

Ok, got past the previous error by installing version 8.5 of nodejs.

Now I have another issue. The build with gradlew completes successfully. I can run the gerrit_download.sh script. I get an error when running the gerrit_stats.sh script.

I've been looking at this most of the day and believe this is turning out to be something with webpack. I'm hoping this looks familiar with someone.

[email protected] webpack /home/rschmitt/git/gerritstats/GerritStats
webpack --display-error-details --colors --progress --config webpack.config.js
Hash: f1817f83ea7482e48620
Version: webpack 1.15.0
Time: 20910ms
Asset Size Chunks Chunk Names
4713eef7edb06b1e8b4e1e4a6c489a5c.png 19.8 kB [emitted]
a3b60647ef11633dfce07443e8ebcc56.png 19.8 kB [emitted]
bundle.js 3.04 MB 0 [emitted] main

  • 730 hidden modules
    ERROR in getOptions is not defined
    @ ./src/main/frontend/index.jsx 5:0-28

ERROR in getOptions is not defined
@ ./src/main/frontend/index.jsx 3:0-43

There are many more of those ERROR in getOptions in the output.

This is crossposted to a webpack mailing list as well. Any ideas?

@holmari
Copy link
Owner

holmari commented Dec 21, 2017

@bluepeach is this still an issue? I see you have also filed webpack/loader-utils#99 .

@connectedway
Copy link

connectedway commented Dec 23, 2017

(this is @bluepeach)

Well, it probably still is an issue. I worked on it a bit more and then just decided to move on to other things. I was hoping to use it though to get status from our gerrit projects. Figured I'd wait for some future release and try again.

@ssbarnea
Copy link

We could also rephrase the bug to "it doesn't build anymore on most platforms". Also tried RHEL, Fedora and MacOS, broken on all of them.

@butterl
Copy link

butterl commented Feb 2, 2018

@bluepeach @holmari I build with ubuntu 16.04 LTS and node v8.5, it keeps looking for v3.13.1/linux-x64-57_binding.node but this really not exist on github, do you got any idea on it?

13:33:57.847 [QUIET] [system.out] > [email protected] install /home/test/code/gerritstats/GerritStats/node_modules/node-sass
13:33:57.847 [QUIET] [system.out] > node scripts/install.js
13:33:57.847 [QUIET] [system.out]
13:33:58.079 [QUIET] [system.out] Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/linux-x64-57_binding.node
13:34:00.815 [ERROR] [system.err] Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/linux-x64-57_binding.node":
13:34:00.816 [ERROR] [system.err]
13:34:00.816 [ERROR] [system.err] HTTP error 404 Not Found
13:34:00.816 [ERROR] [system.err]
13:34:00.816 [ERROR] [system.err] Hint: If github.com is not accessible in your location
13:34:00.816 [ERROR] [system.err]       try setting a proxy via HTTP_PROXY, e.g.
13:34:00.817 [ERROR] [system.err]
13:34:00.817 [ERROR] [system.err]       export HTTP_PROXY=http://example.com:1234
13:34:00.817 [ERROR] [system.err]
13:34:00.817 [ERROR] [system.err] or configure npm proxy via
13:34:00.818 [ERROR] [system.err]
13:34:00.818 [ERROR] [system.err]       npm config set proxy http://example.com:8080

@james-nesbitt
Copy link

OK, so I am not using Ubuntu, but here are some instructions on how I got this to build on Linux. A quick warning is that it ain't pretty.

First off, a better list of dependencies:

  1. libsass -> to render sass to css
  2. g++ -> which is used by node-gyp to build a library based on libsass for your platform
  3. npm (Mine was version 6.5.0) or yarn (mine was 1.7.0)

What we are going to do is separate the build into 2 steps. The node build for GerritStats, and the Application build from root. To do that we will disable the Gradle npm dependency, and then just handle it ourselves.

A. Node stuff

In the GerritStats folder, and run run npm update (or yarn update) instead of running npm install. This doesn't just install the dependencies as listed in the package-lock.json file, but checks for platform related updates - which is what is killing the npm for me.
If this finishes, then you are good. If this doesn't finish, it will give you a much better error output than gradle does, so you can actually diagnose the error.

Note that I tried several different approaches with inconsistent results, but suffice it to say, if you can get npm/yarn to finish, then you can move on.

B Gradle run

Edit the file /GerritStats/build.gradlew and comment out that line the says processResources.dependsOn npmInstall by putting // in front of it. Then run the gradle wrapper as instructed in the README: ./gradlew assemble

DONE

Why does this fix it?

Well the older npm version delcared in the package-lock.json, which might make sense for MacOS, actually causes issues on other platforms, as newer versions have fixed a number of threading/dependency issues.
If you get the ENOENT error related so {something}.DELETE, then you are getting this issue. Some people get this error when using Visual-Code, which appears to be competing for file resources.

@holmari is you are interested, I will submit a PR with an updated package-lock.json

@holmari
Copy link
Owner

holmari commented May 24, 2018

@james-nesbitt, happy to accept any PRs. I'm sorry I don't have time to actively maintain this project, I'm not using Gerrit anymore at my current workplace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants