Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Problem buiding on linux #587

Closed
retog opened this issue Jul 9, 2017 · 33 comments
Closed

Problem buiding on linux #587

retog opened this issue Jul 9, 2017 · 33 comments

Comments

@retog
Copy link

retog commented Jul 9, 2017

Operation System: Debian GNU/Linux 8 (jessie)"
Beaker Version: master branch at d96c38a (Fri Jul 7 17:56:07 2017 -0500)

running

npm run rebuild

fails with

[12:12:23] 'bundle' errored after 3.86 s
[12:12:23] Error: Cannot find module 'remarkable' from '/usr/src/app/app'
    at /usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:46:17
    at process (/usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:173:43)
    at ondir (/usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:188:17)
    at load (/usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:117:15)

npm ERR! Linux 4.4.0-83-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "rebuild"
npm ERR! node v6.2.1
npm ERR! npm  v3.9.3
npm ERR! code ELIFECYCLE
npm ERR! beakerbrowser@ rebuild: `(cd app && npm rebuild --runtime=electron --target=1.7.3 --disturl=https://atom.io/download/atom-shell --build-from-source); gulp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the beakerbrowser@ rebuild script '(cd app && npm rebuild --runtime=electron --target=1.7.3 --disturl=https://atom.io/download/atom-shell --build-from-source); gulp build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the beakerbrowser package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     (cd app && npm rebuild --runtime=electron --target=1.7.3 --disturl=https://atom.io/download/atom-shell --build-from-source); gulp build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs beakerbrowser
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls beakerbrowser
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/npm-debug.log

npm-debug.log.txt

Running npm run burnthemall failed too

@pfrazee
Copy link
Member

pfrazee commented Jul 9, 2017

How did burnthemall fail? You're missing an npm dependency, so burnthemall is one of the best ways to solve it.

@pfrazee pfrazee added the bug label Jul 9, 2017
@millette
Copy link

I regularly pull from master and rebuild, usually with burnthemall and it always worked. Also running Jessie.

@pmario
Copy link
Contributor

pmario commented Jul 14, 2017

I'm not sure, but there are about 20 version between your node 6.2.1 and the actual version. ...

see: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V6.md#6.11.1 ..
So may be you should try to update node?

@weiji14
Copy link

weiji14 commented Jul 21, 2017

I'm trying to build a docker 🐳 beaker-browser (Dockerfile here) with the following specs:

Base image: Debian Buster-slim
Node version: 6.11.1 (updated to latest on build)

The docker instance is very minimal, and using trial and error, the following were the libraries that seemed to be needed:

RUN apt-get -qq update && apt-get install -y --no-install-recommends \
    # Main build dependencies
    libtool \
    m4 \
    automake \
    make \
    g++ \

    # Other build required dependencies
    git \
    ca-certificates \
    curl \
    gnupg \

    # Some X11 GUI dependencies for electron, and python for node-gyp
    libgtk2.0-0 \
    libx11-xcb1 \
    libxtst6 \
    libxss1 \
    libgconf-2-4 \
    libnss3 \
    libasound2 \
    python

@retog I did stumble on the Cannot find module 'remarkable' error once in my trial and error dependency search but I got carried away and can't reproduce it anymore to see what's causing it :/

Running docker run --rm -it -v /tmp/.X11-unix/:/tmp/.X11-unix/ beaker-browser gives me:

> @ start /home/beaker/beaker
> gulp start

[04:24:33] Using gulpfile ~/beaker/gulpfile.js
[04:24:33] Starting 'start'...
Spawning electron /home/beaker/beaker/node_modules/electron/dist/electron
[04:24:33] Finished 'start' after 3.15 ms

Which looks fine. But I don't see any browser popping up... 😅 I'm not quite familiar with nodejs/npm tbh, so could someone kindly point me to how I can start using this very 🆒 browser?!

@retog
Copy link
Author

retog commented Jul 21, 2017

@pmario I actually downgraded to the 6.2.1 version of node, after it didn't work with newer version I decided to use the version recommended by the README.

@weiji14 I'm also trying to run things in docker (but connecting X11 via ssh), the Dockerfile is here: https://github.com/retog/beaker/blob/master/Dockerfile

@pfrazee I'm running burnthemall again (it takes a long time) and I'll let you know about the output/error

@pmario
Copy link
Contributor

pmario commented Jul 21, 2017

@retog I know, that node V8+ doesn't work atm. I didn't try v7. For me 6.11.1 works.

@retog
Copy link
Author

retog commented Jul 23, 2017

@pfrazee burnthemall ends with the following output


[10:05:33] Finished 'less' after 22 ms
'TimeoutError' is imported from external module 'beaker-error-constants' but never used
'TimeoutError' is imported from external module 'beaker-error-constants' but never used
'TimeoutError' is imported from external module 'beaker-error-constants' but never used
'default' is imported from external module 'function-queue' but never used
'default' is imported from external module 'moment' but never used
[10:05:35] 'bundle' errored after 2.4 s
[10:05:35] Error: Cannot find module 'remarkable' from '/usr/src/app/app'
    at /usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:46:17
    at process (/usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:173:43)
    at ondir (/usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:188:17)
    at load (/usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /usr/src/app/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:117:15)

npm ERR! Linux 4.4.0-83-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "rebuild"
npm ERR! node v6.2.1
npm ERR! npm  v3.9.3
npm ERR! code ELIFECYCLE
npm ERR! beakerbrowser@ rebuild: `(cd app && npm rebuild --runtime=electron --target=1.7.4 --disturl=https://atom.io/download/atom-shell --build-from-source); gulp build`
npm ERR! Exit status 
1
npm ERR! 
npm ERR! Failed at the beakerbrowser@ rebuild script '(cd app && npm rebuild --runtime=electron --target=1.7.4 --disturl=https://atom.io/download/atom-shell --build-from-source); gulp build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the beakerbrowser package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     (cd app && npm rebuild --runtime=electron --target=1.7.4 --disturl=https://atom.io/download/atom-shell --build-from-source); gulp build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs beakerbrowser
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls beakerbrowser
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/npm-debug.log

npm ERR! Linux 4.4.0-83-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "burnthemall"
npm ERR! node v6.2.1
npm ERR! npm  v3.9.3
npm ERR! code ELIFECYCLE
npm ERR! beakerbrowser@ burnthemall: `rm -Rf ./node_modules ./app/node_modules; npm i; npm run rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the beakerbrowser@ burnthemall script 'rm -Rf ./node_modules ./app/node_modules; npm i; npm run rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the beakerbrowser package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rm -Rf ./node_modules ./app/node_modules; npm i; npm run rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs beakerbrowser
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls beakerbrowser
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/npm-debug.log
root@6a7464edad36:/usr/src/app# 

npm-debug.log.txt

@pfrazee
Copy link
Member

pfrazee commented Jul 23, 2017 via email

@pmario
Copy link
Contributor

pmario commented Jul 23, 2017

Just tested it with ubuntu 17.04 node v6.2.1 with burnthemall ... it worked. So no extra info atm

@pfrazee
Copy link
Member

pfrazee commented Jul 23, 2017

@retog I'm not finding anything obvious

If you do less app/node_modules/remarkable/package.json from /usr/src/app, what do you get? Is the module there?

weiji14 added a commit to weiji14/beaker-browser that referenced this issue Jul 24, 2017
Temporary commit to reproduce burnthemall error from beakerbrowser/beaker#587 (comment) by changing user from beaker to root.
@weiji14
Copy link

weiji14 commented Jul 24, 2017

I've reproduced @retog 's burnthemall error in my dockerfile simply by changing from a standard user to running npm install as root O.O

See https://www.diffchecker.com/WKSO4NzK for the output log comparison (left is mine, right is retog's error from above). I can post more output logs if necessary.

@pfrazee if I can speak for @retog, there is no node_modules/remarkable/package.json in that failed build.

@retog
Copy link
Author

retog commented Jul 26, 2017

@weiji14 I could refactor the Dockerfile not to use the root user. It would add some complexity as the node:*-onbuild image would no longer be usable, I think.

@pfrazee
Copy link
Member

pfrazee commented Jul 26, 2017 via email

@absullivan
Copy link

@pfrazee I'm very excited about Beaker Browser and hashbase.io, but I could not install the new version of beaker on Ubuntu MATE 16.04. I had been able to install and run an earlier version of beaker and the cli. Thanks!

@pfrazee
Copy link
Member

pfrazee commented Jul 28, 2017

@absullivan I'm hitting this today. Thanks for being patient everyone

@pfrazee
Copy link
Member

pfrazee commented Aug 2, 2017

@retog I'm not able to reproduce this in Ubuntu 16 with node 7. Looking back at your original report, "npm run burnthemall" is failing the rm step. That usually means a path or permissions problem. I'm wondering if there are modules getting installed as root, and then you run burnthemall as nonroot?

@absullivan what did you run into?

@absullivan
Copy link

absullivan commented Aug 3, 2017 via email

@absullivan
Copy link

absullivan commented Aug 3, 2017 via email

@pfrazee
Copy link
Member

pfrazee commented Aug 3, 2017

@absullivan Im starting to think sudo is the culprit. Can you try doing a fresh clone?

git clone https://github.com/beakerbrowser/beaker.git
cd beaker
npm install
npm run rebuild
npm start

You won't lose any data if you do this (data is in another dir).

@absullivan
Copy link

absullivan commented Aug 6, 2017 via email

@pfrazee
Copy link
Member

pfrazee commented Aug 6, 2017 via email

@absullivan
Copy link

absullivan commented Aug 7, 2017 via email

@pfrazee
Copy link
Member

pfrazee commented Aug 7, 2017

👍 Sweet. I'll put together a "beginners guide to beaker" for all that.

@pfrazee pfrazee closed this as completed Aug 7, 2017
@retog
Copy link
Author

retog commented Aug 10, 2017

Still no luck here. From the various comments it seems the problem can be avoided by building and running as a non-root user. I'm wondering why this is.

@dsun29
Copy link

dsun29 commented Oct 9, 2017

I have the same error with CentOS7.3 and Node8.6.npm run burnthemall makes no difference. Advice please?

[update] I tried to install all modules reporting missing one by one using npm install --save xx. After 10 or so individual modules including remarkable, moment, co and more, I hit a rock with builtin-pages-lib. NPM says "Not Found: builtin-pages-lib@latest"

[update 2] I figured out I didn't have gulp installed - I am really new to gulp

@pfrazee
Copy link
Member

pfrazee commented Oct 9, 2017

@dsun29 did you do you install using sudo? It seems other people solved their issue by not using sudo during the install flow.

@pfrazee
Copy link
Member

pfrazee commented Oct 10, 2017

From #694 (comment)

I made beakerbrowser work in my OpenSuse42.2 (Node V6.11). However I cannot make it work in CentOS (Node V8.3). In CentOS it says when running npm install
lifecycle beakerbrowser@~postinstall: cannot run in wd %s %s (wd=%s) beakerbrowser@ cd app && npm install /root/beaker

I'm going to reopen till it's clear why this is happening. I still suspect it's permissions.

@pfrazee pfrazee reopened this Oct 10, 2017
@dsun29
Copy link

dsun29 commented Oct 11, 2017

@pfrazee I did everything under root in CentOS in the last try but still had no luck. So I don't think it is permission issue. It may be something with my CentOS desktop though since it is first time you heard it. I am going to give it another try this evening when I get back to home. Thank you so much for taking time looking at this. I really love beaker.

@pfrazee
Copy link
Member

pfrazee commented Oct 11, 2017

@dsun29 appreciate you being patient with us! I dont have a centos install but I could add it to a list of future VM todos.

Out of curiosity, could you try doing an install with a non root user and no sudo? I'm wondering if part of our setup process might somehow run as another user. Seems unlikely but worth double checking. (My familiarity with linux falls short here.)

@dsun29
Copy link

dsun29 commented Oct 12, 2017

@pfrazee you are so right about "non-root" user. I created a new user and this time the installation was so smooth!! I am using beaker now.

Also, under root I found that npm install won't install modules in subfolder ./app even though npm is supposed to do so. I don't know why. Anyway, cd app && npm install will fix the issue

@Chickensoupwithrice
Copy link

Chickensoupwithrice commented Oct 28, 2017

I have run into this problem as well, but I've been running as non-root user the entire time. I think this is a permissions problem as looking at the npm-debug.log node is trying to install to /usr/lib/node_modules, which my user account doesn't have access too. I think this may be because I installed node in a strange way, but I can't remember. Not really sure what else I should try except reinstalling node.

npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "gulp"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/soup/bin/software/beaker/npm-debug.log````

@millette
Copy link

Old Stack Overflow thread: How to npm install global not as root?

Basically, if npm install -g [whatever] doesn't work because of permissions, don't simply sudo npm install -g [whatever] because that will lead to more confusion.

You'll want to install node (and manage multiple versions if needed) with either

I prefer n but nvm is very popular.

@pfrazee
Copy link
Member

pfrazee commented Nov 9, 2017

Yeah, @millette has the right solution for the last issue. Looks like, in all cases, you just need to avoid using root privileges to do the build/install.

We're going to have a linux build soon (appimage)

@pfrazee pfrazee closed this as completed Nov 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants