Home / GitHub Page

What dev environment and tools do you use?


#1

Hello,

what operating system do you develop on? Linux?
Since the development script is named run.sh, i assume it’s not Windows. (Which is my platform of choice, so I’ll at least try to get it running here.)

Has anyone done this already?

(ps: thanks for the forum, @laurent! Yay!)
(pps: also, first!!!11 :wink: )


#2

I use a bit of a strange hybrid environment at the moment. I develop under Windows but with WSL for the Posix env. Due to the currently buggy nature of WSL, I install the node runtime, Electron, etc. as native apps under Windows, and then launch them from WSL.

In other words, I run things like “npm install”, “yarn dist”, etc. from the Windows Command, and “run.sh” (which runs the native Windows executable) from WSL.

In general the recommanded environment is Linux I guess since all the tools work better under this OS, but it’s do-able to make it work under Windows.


#3

Thanks. That’s exactly what I wanted to try, so I’ll go with that for now.

(For me, Linux is still a pain from the perspective of user comfort, so I avoid it when I can. :innocent: )


#4

Same here, I like the Posix environment in general but not too keen on existing Linux desktop env.


#5

I think I messed something up already, so I’m starting over. :sweat_smile:

I made a clean install of the WSL, deleted the entire repo and cloned it again.

I do have node and npm installed on my Windows machine, with nothing installed on WSL Ubuntu except the Fish shell.

So how should I proceed now? Follow the build steps for Windows on Windows, then try running run.sh on WSL after everything is installed and all packages restored?
Am I perhaps missing a step somewhere?


#6

That seems correct and should work. What error are you getting?


#7

I no longer have the exact message handy; it was something to the effect of some package not being available or correct and it suggested (directly in the error message) that I delete node_modules and reinstall.
So that’s what I did, but from within WSL this time. (Since I had a clean install of everything and it didn’t work.)

Also I had to install nodejs (and npm) within WSL, because npm didn’t seem to work.

Now I’m getting this error:

ElectronClient> ./run.sh

> Joplin@1.0.83 compile joplin/ElectronClient/app
> node compile-jsx.js && node compile-package-info.js && node ../../Tools/copycss.js --copy-fonts

joplin/ElectronClient/app/node_modules/electron/dist/electron: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory

When I tried googling, I found a suggestion that I install libgtk, which I just did with sudo apt-get install -y libgtk2.0-0.

Not sure it helped, but it definitely did something, since now I’m getting

> Joplin@1.0.83 compile joplin/ElectronClient/app
> node compile-jsx.js && node compile-package-info.js && node ../../Tools/copycss.js --copy-fonts

joplin/ElectronClient/app/node_modules/electron/dist/electron: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory

I guess I could try installing packages and see what happens. :tipping_hand_woman:‍♀️


#8

Okay, so I kept at it until I had these installed:

libxtst6
libx11-xcb1
libgtk2.0-0
libxss1
libgconf-2-4
libnss3
libasound2

No errors now, but it still doesn’t work. Now I get this:

> Joplin@1.0.83 compile joplin/ElectronClient/app
> node compile-jsx.js && node compile-package-info.js && node ../../Tools/copycss.js --copy-fonts

nothing happens and the script finishes and exits. :confused:


#9

Is there any log file that could reveal something useful ?


#10

I think it’s because you did npm install from WSL while you need to do it from Windows. Basically all the tools (npm install, yarn dist, electron, etc.) must be on Windows side and installed from cmd.exe. WSL is just a convenience from which you run the native Windows tools.

However if you do npm install on WSL side that will install a Linux version and so you’ll also need GTK etc. and I’m not sure you’ll manager to get it working.


#11

Well, color me surprised.

This was the first thing I tried and it didn’t work; but now that I wiped node_modules again and installed again from Windows, it works. For some reason. :tipping_hand_woman:‍♀ Thanks.

But after the app starts, I only get a blank window, like this:

What am I doing wrong?


#12

Looks like there’s an error. If you open the Console tab, what does it say?


#13
Uncaught Error: Cannot find module 'D:\Projects\joplin\ElectronClient\app\node_modules\sqlite3\lib\binding\electron-v1.7-win32-x64\node_sqlite3.node'
    at Module._resolveFilename (module.js:470:15)
    at Function.Module._resolveFilename (D:\Projects\joplin\ElectronClient\app\node_modules\electron\dist\resources\electron.asar\common\reset-search-paths.js:35:12)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (D:\Projects\joplin\ElectronClient\app\node_modules\sqlite3\lib\sqlite3.js:4:15)
    at Object.<anonymous> (D:\Projects\joplin\ElectronClient\app\node_modules\sqlite3\lib\sqlite3.js:190:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)

Seems like I’m missing a module, somehow?


#14

I think you need to run yarn dist once on the Windows side to get electron-builder to compile all the native libs like SQLite. After that normally it should work.


Need help running the ElectronClient
#15

It did. Thanks again.

BTW from what I can see, both npm and yarn are dependency managers. Why use both?
(I’m not criticizing your design; I just honestly don’t know what their roles are.)


#16

Good question - I would prefer to use npm only but electron-builder only supports yarn. We also cannot use yarn only because it has a bug that prevents the equivalent of “npm install” to work on this project.


#17

Any suggestions how to get a working dev env on macOS?

Disclaimer: I’m not a JS developer, but it’s never too late to learn something new…


#18

follow chapter macOS here then

  • Building the tools
  • Building the Electron application

#19

Thanks @foxmask. I saw that a while back, but I’m using MacPorts and not brew. Thus it would be great, if there were just minimum version requirements in that file.

e.g. is yarn 1.6.0 ok? (which is available via MacPorts)

Also, since I’m not familiar with JS application development: Is there an IDE that shows you the GUI components while working on the code (like in Xcode)? Let’s say I want to change a certain GUI component, I click on it, and it will jump right to the relevant JS code…


#20

I think it should work with whatever is the latest version of node, npm and yarn on MacPorts. If it does not, please post here and I’ll update the Readme.