Trying to compile sn_browser to most recent sn_node version. Error: Cannot find module 'sn_node'

I’ve been annoying the devs here to get a working browser for sn_cli 0.16/17 for two weeks now.
But yesterday I managed to safe cat a file via LAN and that changes everything for me.

Because if I can get the browser working now, I can start running websites on my raspberry pi.

So I’ve git cloned the master version of sn_browser and switched safe-nodejs with

...
"sn_node": "https://github.com/maidsafe/sn_node.git#0.25.18",
...

And… I get this:

- /home/folaht/safe/sn_browser/node_modules/electron/dist/resources/default_app.asar/main.js
- 
    at Module._resolveFilename (internal/modules/cjs/loader.js:798:15)
    at Function../lib/common/reset-search-paths.ts.Module._resolveFilename (electron/js2c/browser_init.js:7718:16)
    at Module._load (internal/modules/cjs/loader.js:691:27)
    at Function.Module._load (electron/js2c/asar.js:748:26)
    at Module.require (internal/modules/cjs/loader.js:853:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/folaht/safe/sn_browser/app/extensions/safe/webviewProcess/webviewPreload.ts:2:1)
    at Module._compile (internal/modules/cjs/loader.js:968:30)
    at Module._compile (/home/folaht/safe/sn_browser/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:986:10)
03:29:22.671 › >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
03:29:22.672 › whoops! there was an uncaught error:
03:29:22.673 › In the main process
03:29:22.673 › {"message":"Cannot find module 'sn_node'\nRequire stack:\n- /home/folaht/safe/sn_browser/app/extensions/safe/webviewProcess/webviewPreload.ts\n- /home/folaht/safe/sn_browser/app/extensions/safe/index.ts\n- /home/folaht/safe/sn_browser/app/extensions/index.ts\n- /home/folaht/safe/sn_browser/app/reducers/index.ts\n- /home/folaht/safe/sn_browser/app/store/configureStore.dev.ts\n- /home/folaht/safe/sn_browser/app/store/configureStore.ts\n- /home/folaht/safe/sn_browser/app/main.dev.ts\n- /home/folaht/safe/sn_browser/node_modules/electron/dist/resources/default_app.asar/main.js\n- ","name":"Error"}
03:29:22.674 › >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I’m not sure how to deal withthis, because I can find the sn_node folder in node_modules, so shouldn’t be able to find it just fine?

1 Like

Stupid me. sn_node -> sn_nodejs.

I am struggling with this…

Can you help out by posting the command to start sn_authd on one machine, the output from safe auth status on both machines and the command you used to start the nodes on th second machine, please?

Thank you - any other hints very welcome indeed.

1 Like

Steps to start and test network

Server

safe
node run-baby-fleming --ip your.lan.ip.address
auth restart
auth create --test-coins
auth unlock
auth unlock --self-auth
files put /home/yourname/hello_world.txt

Client

safe
networks add lan
networks switch lan
quit
echo "your.lan.ip.address:12000" | tee ~/.safe/cli/networks/lan_node_connection_info.config
safe
auth restart
auth unlock
cat safe://source_path

Most common mistakes

Authd from a previous test is still running

quit
ps -ef | grep authd
kill pid_number_of_authd

Nodes from a previous test are still running

node killall

Auth statuses

Server & Client (output is the same)

> auth status
Sending request to authd to obtain a status report...
+------------------------------------------+--------+
| Safe Authenticator status                |        |
+------------------------------------------+--------+
| Authenticator daemon version             | 0.0.13 |
+------------------------------------------+--------+
| Is there a Safe currently unlocked?      | Yes    |
+------------------------------------------+--------+
| Number of pending authorisation requests | 0      |
+------------------------------------------+--------+
| Number of notifications subscribers      | 0      |
+------------------------------------------+--------+
3 Likes

Merci beaucoup, mon ami

Line 203 in config_handlers.rs now reads

 self.network_config.ip = Some(IpAddr::V4(Ipv4Addr::192.168.100.6));

but I get this failure
➜ sn_node-0.25.18 cargo build --bin launch_network --release --features=simulated-payouts –
Compiling sn_node v0.25.18 (/home/willie/projects/maidsafe/sn_node-0.25.18)
error: expected identifier, found 192.168
–> src/config_handler.rs:203:60
|
203 | self.network_config.ip = Some(IpAddr::V4(Ipv4Addr::192.168.100.6));
| ^^^^^^^ expected identifier

warning: unused imports: `IpAddr`, `Ipv4Addr`
  --> src/config_handler.rs:21:11
   |
21 |     net::{IpAddr, Ipv4Addr, SocketAddr},
   |           ^^^^^^  ^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

error: aborting due to previous error; 1 warning emitted

error: could not compile `sn_node`

To learn more, run the command again with --verbose.
➜  sn_node-0.25.18 

What stupid trivial mistake am I making?

De rien, mon vieux.

Tu oublies « nouveau » et les paramètres de la fonction sont séparés par des virgules.

self.network_config.ip = Some(IpAddr::V4(Ipv4Addr::new(192,168,100,6)));
1 Like

le oops Nom d’un chien!!! et les autre mots mechant Francais aussi :slight_smile:

This topic was automatically closed after 60 days. New replies are no longer allowed.