Coder Social home page Coder Social logo

Comments (11)

damien122 avatar damien122 commented on May 17, 2024 1

Thanks, now it works. I can now start zettlr from source 😄

from zettlr.

nathanlesage avatar nathanlesage commented on May 17, 2024

Hey there,

I cannot reproduce the windows error (I am currently on Win10 Pro x64 with node v8.9.4 and npm v5.6.0 installed), but from what I see the error is produced by the codemirror indentlist plugin postinstall script.

What this script basically does is simply to create an additional file in the plugin directory of the codemirror installation. According to a quick search ELIFECYCLE errors are thrown when there is an error in the script, which would point to two potential cases:

  1. the patch-command does not work, because the necessary package is not installed. Yet, it should be installed automatically on npm install, so I think this is highly unlikely.
  2. There are insufficient write permissions to the node_modules-dir, meaning that the patch-command would fail because it is not allowed to write to node_modules/codemirror.

But I've on other occasions also noticed some complains about npm in general, so maybe try to update to npm v5.6.0 and try it again, maybe this will solve the issue.

As to your linux error, I cannot reproduce it as well, but only because I don't have a linux machine at hand currently. But the error code 126 from the postinstall-script seems to indicate write permission issues, as pointed to in this thread here.

A friend of mine has just tried to run the install scripts on linux (he's using Fedora) and it has worked there.

So I think the errors you are experiencing are pertaining to write permissions. Would you mind trying to clone the repository into your default Documents-folder in your Home directory and install without administrator-permissions in the shell? Maybe this will solve the issues.

Good luck!

from zettlr.

damien122 avatar damien122 commented on May 17, 2024

Hi @nathanlesage,

thanks for your quick answer.
I tryed to update npm to 5.6.0 and it changed something.
Also I try to run powershell with admin permission and one regular powershell and in both I got the same errors.
Do you have maybe installed some necessary packeges global?
Also I try it on a second PC (both with windows 10 x64) and on both I got this errors.

> [email protected] postinstall C:\temp\Zettlr\node_modules\codemirror-markdown-list-autoindent
> patch -p1 -d ../codemirror < markdown-list-autoindent.patch

Der Befehl "patch" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\7zip-bin-linux):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"linux","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\7zip-bin-mac):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `patch -p1 -d ../codemirror < markdown-list-autoindent.patch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Der Befehl "patch" ist entweder falsch geschrieben oder konnte nicht gefunden werden.
Means that the command "patch" is unkown or is writen wrong.

You can also have linux on windows. https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux
In such a WSL it was possible for me to execute the npm install command. But the npm start command was not successful.

Linux Log:

> [email protected] start /mnt/c/temp/Zettlr
> electron .

/mnt/c/temp/Zettlr/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
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: `electron .`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Windows Log:

PS C:\temp\Zettlr> npm start

> [email protected] start C:\temp\Zettlr
> electron .

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\temp\Zettlr\node_modules\electron\dist\electron ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:686:11)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

from zettlr.

nathanlesage avatar nathanlesage commented on May 17, 2024

Ah, this logging output helps better! I think now we can solve both of your problems!

Der Befehl "patch" ist entweder falsch geschrieben oder konnte nicht gefunden werden.

So indeed somehow the patch command does not work.

On windows I try npm install through the normal shell and I think this may solve it. I dislike PowerShell because many commands need to be explicitly routed to their correct aliases. So the German output definitely comes from PowerShell and not from node itself (b/c node is always en_US), which points to the problem that the patch command cannot be referenced from within PowerShell. I'd advise you to simply use the normal shell for npm, because this definitely works.

As to your Linux problem, I believe this is because of the Linux subsystem. As the subsystem only implements shell commands and stuff, not the graphical interface (i.e. the X11-server), this means that running a graphical program such as electron is not possible using the subsystem. This is also indicated in your logging output as it references a missing dependency libgtk-x11-2.0.so.0. This basically tells you "I couldn't find the GTK interface!" (libgtk-x11 is the main library for running graphical programs on a GTK platform such as Ubuntu or Gnome).

I think you definitely need a Virtual Machine if you like to be running an electron app on your windows machine. You could try VirtualBox, because many people I've talked to mentioned it for running Linux systems on a Windows PC (and vice versa), so it should be a good point to start.

Please tell me if it works now!

from zettlr.

damien122 avatar damien122 commented on May 17, 2024

Ok build now works and start also but after npm start the app creshed because it could not pars some files from my local Documents folder. But I don't understand why the app try to pars my files at startup?

from zettlr.

nathanlesage avatar nathanlesage commented on May 17, 2024

This is just as intended.

When Zettlr starts, it needs at least one root directory, and if there hasn't been any, it defaults back to your documents folder. Then it parses the whole directory and reads in all *.txt and *.md files, opens them for read, extracts some information (such as creation date and the first 50 characters) so that it can present to you an initial list of files.

Then you can, from within the app, choose a different folder, if you wish to. Could you please provide some error information?

from zettlr.

damien122 avatar damien122 commented on May 17, 2024

How can I provide an other root dir at startup?
Unfortunatelly I can't upload screenshots here. I got an popup windows with a stacktrace and can't copy the text.

Edit: now I know how to upload screenshots here :D

from zettlr.

damien122 avatar damien122 commented on May 17, 2024

image

from zettlr.

nathanlesage avatar nathanlesage commented on May 17, 2024

… well, that is an interesting error, if even node doesn't know what to do. It shouldn't happen, so I will look into it. But I think it's because of a symlink that Zettlr shouldn't be following.

As for now, until it's fixed, you can find the configuration of Zettlr in C:\Users\<your-username>\AppData\Roaming\Zettlr\config.json

There, simply replace the JSON variable projectDir with a safe directory and try to start the app again.

from zettlr.

nathanlesage avatar nathanlesage commented on May 17, 2024

Good to hear! I'll try to fix the startup error in a next version, though =D

from zettlr.

nathanlesage avatar nathanlesage commented on May 17, 2024

See for further discussion on these problems issue #14.

from zettlr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.