Trouble building dev browser

Hi. I’m new here. Apologies for my ignorance.

Info as per the topic instructions:
What application or program are you running?
Trying to build the Safe Browser for development, running yarn.

What’s the version number? yarn 1.3.2

What are the version numbers of the supporting dependencies that you are using locally? For example, Node.js, NPM, and Rust.
Node v9.5.0, npm 5.6.0, rustc 1.14.0.

Which operating system are you using and which version number?
SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux

What steps did you follow when the error occurred and how can we reproduce it?

  1. I retried the compilation.
  2. I deleted the whole directory and recloned.
  3. I ran ‘yarn run burnthemall’ as instructed in the troubleshooting section of README.md.
    In every case the result was the same.
    Can you advise please? I’m happy to provide whatever other supporting logs you might need. Thanks!

I’m trying to build the browser for development. I’m using Node v9.5.0 but I seem to be getting the same errors as topic Safe browser fails to build under node 9.3.

I am trying to follow the instructions at https://github.com/maidsafe/safe_browser/blob/master/README.md but the first call to yarn ends with lots of compilation errors in ffi.c like this:
In file included from …/…/nan/nan.h:197:0,
from …/src/ffi.h:23,
from …/src/ffi.cc:3:
…/…/nan/nan_maybe_43_inl.h:116:35: note: declared here
NAN_DEPRECATED inline Maybe ForceSet(
^~~~~~~~
…/src/ffi.cc:111:153: error: no matching function for call to ‘v8::Object::ForceSet(v8::Localv8::String, v8::Localv8::Value, v8::PropertyAttribute)’
target->ForceSet(Nan::New(“RTLD_NEXT”).ToLocalChecked(), WrapPointer((char *)RTLD_NEXT), static_cast(ReadOnly | DontDelete));

Joy

1 Like

Hi Joy, welcome!

Did you already try building with Node v8.x.x?

1 Like

Must use the node version supported by electron. It varies depending on the electron version. In the current electron master, the version of node used is 8.2.1. We can not use version above that because the native modules can not be rebuilt.

I just noted that the README could specify the exact version or a version range that it depends on.

As @hunterlester suggested, please do try using node v8.0.0 to be sure that you can build it. I guess it should be fine to use 8.x.x (I have not tried it though)

2 Likes

Hi,
Thanks to all for writing. My apologies for disappearing - both of my main devices died the same day in different ways. I’m writing this on my phone.

I got Node via nvm, ie the thing recommended in the README doc I was reading at the time. I have read the other replies here and am pretty sure I haven’t downloaded or installed anything called electron. I recall seeing mention of it elsewhere on the Safenet site but not in the README. I will check once I get back to the Linux box (perhaps tomorrow) but just now my priority is my old Android tablet with the dying battery. I’m just hoping that my phone keeps going, they say trouble comes in threes, don’t they? :slight_smile:
I shall certainly get electron and use the 8.0.0 version as recommended; I’ll post a summary of my results either way.

2 Likes

Hi all,

I’ve made some progress from my original failure in the initial call to ‘yarn’ in the safe_browser README. As I want to build the dev browser with mock routing, I’m now calling ‘yarn mock’ as instructed. That seems to work as then does ‘yarn run build’ (which finished with a 0) but am now failing in the next call, which is ‘yarn start’.

My current versions of things that I’ve heard of: :wink:
Node v8.2.1, nvm 0.33.8, npm 5.3.0, rustc 1.14.0, yarn 1.5.1.
Am I missing something?

In my environment I have only the following (so far):
NODE_ENV=dev
NVM_DIR=/home/dalroth5/github/nvm
NVM_CD_FLAGS=
NVM_BIN=/home/dalroth5/github/nvm/versions/node/v8.2.1/bin
NODE_VERSION=8.2.1

The error is as follows:
"
yarn run v1.5.1
$ cross-env NODE_ENV=dev gulp start
[11:48:52] Using gulpfile ~/github/safe_browser/gulpfile.js
[11:48:52] Starting ‘start’…
[11:48:52] ‘start’ errored after 6.67 ms
[11:48:52] Error: spawn EACCES
at exports._errnoException (util.js:1024:11)
at ChildProcess.spawn (internal/child_process.js:325:11)
at Object.exports.spawn (child_process.js:493:9)
at Gulp.start (/home/dalroth5/github/safe_browser/tasks/start.js:11:16)
at module.exports (/home/dalroth5/github/safe_browser/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/home/dalroth5/github/safe_browser/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/home/dalroth5/github/safe_browser/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/home/dalroth5/github/safe_browser/node_modules/orchestrator/index.js:134:8)
at /home/dalroth5/github/safe_browser/node_modules/gulp/bin/gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:131:7)
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c cross-env NODE_ENV=dev gulp start
Directory: /home/dalroth5/github/safe_browser
Output:
".
info If you think this is a bug, please open a bug report with the information provided in “/home/dalroth5/github/safe_browser/yarn-error.log”.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
"

The yarn-error.log ends with:
"
Error: Command failed.
Exit code: 1
Command: sh
Arguments: -c cross-env NODE_ENV=dev gulp start
Directory: /home/dalroth5/github/safe_browser
Output:

  at ProcessTermError.MessageError (/usr/share/yarn/lib/cli.js:186:110)
  at new ProcessTermError (/usr/share/yarn/lib/cli.js:226:113)
  at ChildProcess.<anonymous> (/usr/share/yarn/lib/cli.js:30281:17)
  at emitTwo (events.js:125:13)
  at ChildProcess.emit (events.js:213:7)
  at maybeClose (internal/child_process.js:921:16)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

"
I confess I’m still floundering to understand this stuff, in particular the boundaries between tools, dependencies, frameworks, dummy things for dev purposes, actual code…and these are only the known unknowns! :slight_smile:
Should I upload the yarn-error.log in full, maybe?

1 Like

Hi Joy,

Error: spawn EACCES is indicating that NodeJS doesn’t have permission, via the current user, to spawn a child process for electron using the ./app directory in the SAFE browser repository, if I’ve got that right.

Common answers on StackOverflow would instruct you to chmod the ./app directory but I would hesitate to do that until we figure out if it is indeed the culprit and why the permissions are not set for you already.

If you ls -al in the root of your SAFE Browser directory, I’d be curious to see which permissions are set on the directories and files.

DM me if you want to get on a Google hangout for further debug help.

Will do, thanks. I’ve also now discovered the tutorial “How to build the SAFE Browser and upload a website with Mock-Vault” so I’m skipping the ‘yarn start’ and going straight to ‘yarn run package’ etc as instructed in there. I’ll let you know what happens.

Hi @hunterlester,

The result of ‘ls -al’ in the root of my SAFE Browser directory:
drwxr-xr-x 12 dalroth5 dalroth5 4096 Feb 27 17:20 .
drwxr-xr-x 5 dalroth5 dalroth5 4096 Feb 27 13:01 …
drwxr-xr-x 11 dalroth5 dalroth5 4096 Feb 26 21:21 app
-rw------- 1 dalroth5 dalroth5 2683 Feb 25 18:48 appveyor.yml
-rw------- 1 dalroth5 dalroth5 37 Feb 25 18:47 .babelrc
-rw------- 1 dalroth5 dalroth5 1251 Feb 25 18:48 BEAKER_LICENSE.md
drwxr-xr-x 3 dalroth5 dalroth5 4096 Feb 26 21:35 build
-rw------- 1 dalroth5 dalroth5 7232 Feb 25 18:48 build-notes.md
-rw------- 1 dalroth5 dalroth5 2955 Feb 25 18:48 CHANGELOG.md
drwxr-xr-x 2 dalroth5 dalroth5 4096 Feb 25 18:48 config
-rw------- 1 dalroth5 dalroth5 68 Feb 26 21:34 .directory
drwxr-xr-x 3 dalroth5 dalroth5 4096 Feb 27 18:06 dist
drwxr-xr-x 2 dalroth5 dalroth5 4096 Feb 26 21:35 doc
drwxr-xr-x 4 dalroth5 dalroth5 4096 Feb 25 18:48 docker
-rw------- 1 dalroth5 dalroth5 19 Feb 25 18:47 .dockerignore
-rw------- 1 dalroth5 dalroth5 233 Feb 25 18:47 .editorconfig
drwxr-xr-x 8 dalroth5 dalroth5 4096 Feb 25 18:47 .git
-rw------- 1 dalroth5 dalroth5 184 Feb 25 18:47 .gitignore
-rw------- 1 dalroth5 dalroth5 72 Feb 25 18:48 gulpfile.js
-rw------- 1 dalroth5 dalroth5 213 Feb 25 18:48 ISSUE_TEMPLATE
drwxr-xr-x 688 dalroth5 dalroth5 20480 Feb 26 19:04 node_modules
-rw------- 1 dalroth5 dalroth5 3152 Feb 25 18:48 package.json
-rw------- 1 dalroth5 dalroth5 2444 Feb 25 18:48 README.md
-rw------- 1 dalroth5 dalroth5 264060 Feb 25 18:48 screenshot.png
drwxr-xr-x 2 dalroth5 dalroth5 4096 Feb 25 18:48 scripts
drwxr-xr-x 3 dalroth5 dalroth5 4096 Feb 25 18:48 tasks
-rw------- 1 dalroth5 dalroth5 2304 Feb 25 18:47 .travis.yml
-rw-r–r-- 1 dalroth5 dalroth5 205969 Feb 27 18:02 yarn-error.log
-rw------- 1 dalroth5 dalroth5 190675 Feb 25 18:48 yarn.lock
ie all owned by me with rw(x) permissions.

(later)

Great news. The ‘yarn run package’ finally got all the way through to a 0 finish, and I have just successfully launched the dev version (I presume) of the SAFE Browser. :smiley:

I think you can probably close this thread now, while I go off to read about how to make use of this new app.

I’m thinking that a Bash script to automate this setup process would be a good idea. After offering the caller a choice of dev version or testing, it would ideally pick up the correct current version numbers from the repository, then go through the procedure I’ve just sort of cobbled together with much help from yourself. Is there such a thing around here already? If so, can you point me to it please, and if not, shall I have a go at drafting one?

3 Likes

That’s great news although I’m still curious about why you were receiving an EACCESS when trying to yarn start.

Yes, please, I’d love to get a bit more education about bash scripting.

1 Like

Hello guys!

My name is Greg Smith. I am very interested in learning more about the Safe Network Technology! I know some C, C++(beginner level) , and some web development scripting languages. I would love to do some development on top of the Safe Network API at some point. On my attempt to build the dev browser, whatsoever, I ran into some installation problems with yarn, just like joyous did.

What are the version numbers of the supporting dependencies that you are using locally?
Node.js, NPM, and Rust.
Node v8.2.1, npm 5.3.0, rustc 1.19.0.

Which operating system are you using and which version number?
System Version: macOS 10.12.6 (16G1114)
Darwin Kernel Version 16.7.0: Mon Nov 13 21:56:25 PST 2017; root:xnu-3789.72.11~1/RELEASE_X86_64

Also just like joyous did, I:

I retried the compilation.
I deleted the whole directory and recloned.
I ran ‘yarn run burnthemall’ as instructed in the troubleshooting section of README.md.

The result the same. Please advise.

Thanks!

sudo yarn
Password:
yarn install v0.27.5
warning “redux-devtools@3.4.1” has unmet peer dependency “react@^0.14.9 || ^15.3.0 || ^16.0.0”.
warning “redux-devtools@3.4.1” has unmet peer dependency “react-redux@^4.0.0 || ^5.0.0”.
warning “redux-devtools@3.4.1” has unmet peer dependency “redux@^3.5.2”.

warning …/…/…/package.json: No license field
Downloading tmp-41414-0-safe_app-v0.6.0-osx-x64.zip
[> ] 0.0% (0 B/s)
events.js:182
throw er; // Unhandled ‘error’ event
^

Error: EACCES: permission denied, open ‘src/native/prod/libsystem_uri.dylib’
error Command failed with exit code 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @maidsafe/safe-node-app@0.8.0 postinstall: yarn run install-prod && node install-dev-libs.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @maidsafe/safe-node-app@0.8.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/greg/.npm/_logs/2018-03-09T16_43_32_833Z-debug.log
error Command failed with exit code 1.
error Command failed with exit code 1.

Hi Greg! A warm welcome to the community.

Are you finding helpful resources to get started learning how to develop?

Based on the EACCES error, if you cd into ‘src/native/prod/libsystem_uri.dylib’ what are the permissions set for that file?

What permissions do you have as a user in your terminal? Do you need to use sudo or is it possible to run yarn without it?

1 Like

Hi guys,

Just a quick update: I’ve been knocking together a Bash script to build either the dev or prod version of the browser but it isn’t finished yet. I’m testing it with Debian 9 in a VM but aiming to generalise it to cover at least Linux Mint and OpenBSD since I’ve seen mention of those as OS that folk are using.

I haven’t yet managed to get it all to work in my test VM…and just to make my life complete I can’t get the install to work now in my regular shell session either. :slight_smile:

A question for @hunterlester: is npm still a requirement or has it been superseded by nvm? IOW do I really need both? Thanks!

3 Likes

I’ve a Linux Mint to test your script.

Nvm is a node js version manager that takes care of installing node and npm . When using nvm, it’s recommended to uninstall previously installed versions of Node and npm.

1 Like

Thanks a lot for your response hunterlester!

I am still browsing through the Safe dev forum, but if you have any suggestions to get started learning how to develop in the Safe Network they will be very welcome!

I ‘cd’ into:
safe_browser/app/node_modules/@maidsafe/safe-node-app/src/native/prod/libsystem_uri.dylib

the file permissions are:
-rw-r–r-- 1 root staff 6139664 Mar 9 11:42 libsystem_uri.dylib

I am running as a root user, and yes, I need to sudo to run yarn

Update: I think I figured out, and I am past that problem, since it compiled with no errors…
Thanks for the tip!

I changed the ownership of the safe_browser directory to my user account (greg), and that seemed to fix the issue. I log in as root, and that seems to cause problems…

Thanks!

1 Like

Hi guys,

I am not quite done yet building the dev browser, unfortunately. After doing a yarn start, it launches the electron app, but also throws a javascript error, and in the command line gives:

yarn start
yarn start v0.27.5
$ cross-env NODE_ENV=dev gulp start
[15:09:44] Using gulpfile ~/safe_browser/gulpfile.js
[15:09:44] Starting ‘start’…
[15:09:44] Finished ‘start’ after 3.45 ms
Opening beaker:shell-window
ERROR: Error: Dynamic Linking Error: dlopen(/Users/greg/safe_browser/app/node_modules/@maidsafe/safe-node-app/src/native/mock/libsafe_app.dylib, 10): image not found
at new DynamicLibrary (/Users/greg/safe_browser/app/node_modules/ffi/lib/dynamic_library.js:74:11)
at Object.DynamicLibrary (/Users/greg/safe_browser/app/node_modules/ffi/lib/dynamic_library.js:33:12)
at Object.ffi.init (/Users/greg/safe_browser/app/node_modules/@maidsafe/safe-node-app/src/native/lib.js:20:15)
at SAFEApp (/Users/greg/safe_browser/app/node_modules/@maidsafe/safe-node-app/src/app.js:36:9)
at Object.initializeApp (/Users/greg/safe_browser/app/node_modules/@maidsafe/safe-node-app/src/index.js:61:25)
at /Users/greg/safe_browser/app/node_modules/beaker-plugin-safe-app/dist/protocol.js:1517:20
at Promise ()
at initialiseSafeApp (/Users/greg/safe_browser/app/node_modules/beaker-plugin-safe-app/dist/protocol.js:1509:10)
at Object.registerSafeProtocol [as register] (/Users/greg/safe_browser/app/node_modules/beaker-plugin-safe-app/dist/protocol.js:1585:10)
at /Users/greg/safe_browser/app/background-process.build.js:267:20
(node:46992) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): 1000: Failed to load native libraries: Error: Dynamic Linking Error: dlopen(/Users/greg/safe_browser/app/node_modules/@maidsafe/safe-node-app/src/native/mock/libsafe_app.dylib, 10): image not found
(node:46992) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
ERROR: Error: Dynamic Linking Error: dlopen(/Users/greg/safe_browser/app/node_modules/@maidsafe/safe-node-app/src/native/mock/libsafe_app.dylib, 10): image not found
at new DynamicLibrary (/Users/greg/safe_browser/app/node_modules/ffi/lib/dynamic_library.js:74:11)
at Object.DynamicLibrary (/Users/greg/safe_browser/app/node_modules/ffi/lib/dynamic_library.js:33:12)
at Object.ffi.init (/Users/greg/safe_browser/app/node_modules/@maidsafe/safe-node-app/src/native/lib.js:20:15)
at SAFEApp (/Users/greg/safe_browser/app/node_modules/@maidsafe/safe-node-app/src/app.js:36:9)
at Object.initializeApp (/Users/greg/safe_browser/app/node_modules/@maidsafe/safe-node-app/src/index.js:61:25)
at netStateCallbackHelper (/Users/greg/safe_browser/app/node_modules/beaker-plugin-safe-app/dist/api.js:230:11)
at Object.module.exports.module.exports._with_async_cb_initialise [as initialise] (/Users/greg/safe_browser/app/node_modules/beaker-plugin-safe-app/dist/api.js:391:10)
at Promise (/Users/greg/safe_browser/app/background-process.build.js:1631:32)
at Promise ()
at authoriseApp (/Users/greg/safe_browser/app/background-process.build.js:1629:10)

1 Like

Nice, you’re so close!
Did you set NODE_ENV=dev when you ran yarn?

1 Like

@draw:
Hi,
Sorry for such a late reply, my First Life has been claiming more of my time lately.
Thanks for the offer of a test bed, gratefully accepted. :slight_smile:
Once I’ve got it working in my various test VMs I’ll pass it along for you to have a go at.

2 Likes

BTW all,
My script assumed a non-root user (as is normal for Unixy OS), and the Unixy version does things with .bashrc at the moment. An improvement I intend is to refactor that, so that once the script has been downloaded and run, the user gets new Start menu entries in their OS to select dev or prod versions. A still better script would offer a list of runnable versions kept up to date automagically. :-))

2 Likes