Errors after running npm install on joplin root director

Following this instructions https://github.com/laurent22/joplin/blob/master/BUILD.md
after cloning the joplin app from https://github.com/laurent22/joplin.git and ran npm install

I got bunch of errors on my terminal, am using windows 10

the last few lines of the error message are:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! joplin@1.0.0 postinstall: cd ReactNativeClient && npm i && cd .. && cd ElectronClient && npm i && cd .. && cd CliClient && npm i && cd .. && gulp build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the joplin@1.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

kindly looking for support
-cheers

We are missing the output. We can see there's an error, but not why. This serror message is useless.

@marijawo
Firstly clean the node modules in the root(maybe do a fresh start by deleting joplin-master and reinstalling it back from github)

okay if you are building on windows run this first
npm install --global windows-build-tools

then in root folder run
npm install

it should work, it might take upto 15-20 minutes but be patient with it, it will work

1 Like

@rishabh.malhotra will try that. Thanks

Can windows-build-tools be added to package.json or does it have to be a separate global command?

I’m not really sure about this so I did some digging,

  • Firstly you need to be in administrator mode for this command to run properly (basically run in PowerShell and not git bash)
  • After running npm init --y in an empty folder when I did run npm install windows-build-tools the dependency did install



  • here are the screenshots of package.json file and package.json.lock file


So I believe YES, it can be added to package.json file.

Master branch was doing the same thing for me on Linux earlier. Anyone have any suggestions on how to fix it there since the fix above wouldn’t work there?

@rishabh.malhotra, thanks for checking but I guess it would need to be tested on a system where the tools are not already installed globally, to check that it’s indeed using the ones in package.json. But I see that the author of wbt recommends against putting this in devDependencies so I guess we should avoid it too: https://github.com/felixrieseberg/windows-build-tools/issues/166

Perhaps we should however added in BUILD.md that the wbt should be installed on Windows.

1 Like

What error was it? As OP didn't post the actual error.

@laurent Should I update BUILD.MD?

I was tired and didn't read the full error. I was missing rsync on my system and just saw NPM ERR above

Oh that’s right, I always forget that rsync is not default everywhere. I’m using it to copy files because it’s much faster than gulp copy operations.

Hmm, I wonder if there could be a step to check dependencies before building the app. Rsync, CocoaPods on Mac, and maybe a few others need to be installed.

1 Like

On checking dependencies, at least for Linux, that could definitely be a pain to get going due to how many different package managers are available. Instead, is there anyway to create a static binary that could just be pulled from a repo and ran locally inside Joplin? Binaries should be ok to include under the GPL but the source code could definitely be an issue here if included in any form.

https://rsync.samba.org/

there is discussion ongoing in GSoC mailing list to have a Google Summer of Code "Downunder". As alternative https://people.communitybridge.org/ was brought up.
May we find some help, guidance or even dev support there