Portable Node.js TW won't start on new Linux machine from OneDrive

I don’t want to run Tiddlywiki as an exe file, I want to run it on node, so I have access to individual tiddlers as files.

Hi @mobil_gmail.com (I present a few options here…)

Powershell Shortcut

I followed your instructions, the command promt will get hidden but Tiddlywiki will not start.

I may be able to help you if you could provide some details. Try the following command for the shortcut so you can see the errors:

powershell -noExit ./tiddlywiki.cmd mynewwiki --listen

Things that might have gone wrong:

  • Note that ./ prefixing tiddlywiki.cmd is not optional. You need to tell powershell that the command is located in the current directory.

  • powershell will try to run tiddlywiki.ps1 script if you do not give an extension. Your powershell may have an execution policy that denies you from running a powershell script. Therefore, specify tiddlywiki.cmd for better luck.

  • TiddllyWiki will not start if the port (default = 8080) is already taken. Probably not the case here…

Both .cmd and .ps1 scripts will ultimately run node.exe node_modules/tiddlywiki/tiddlywiki.js

Once you can get the shortcut up and running, repace the -noExit option with -windowstyle hidden again.


VBScript

Alternatively, here’s a simple VBScript that’ll start up tiddllywiki on node.js with the console hidden:

Set shl = CreateObject("Wscript.Shell")

wikiFolder = "mynewwiki"

' second arg: 0 to hide; 1 to display the window
Call shl.Run("%COMSPEC% /k tiddlywiki.cmd " & wikiFolder & " --listen", 0)

WScript.Quit

Edit the value of wikiFolder to something else, if necessary.

Save the content into a file with .vbs extension in your node.js folder. Double click on the file to run. If you need to debug, change the value of the last argument of shl.Run(...) from 0 to 1 to un-hide the running window. Once it’s working, you can get fancy with the script, e.g. to supply wikiFolder from the command line, etc.


Windows Task Scheduler

Another option would be using the Windows “Task Scheduler” to run a windows task. I’ve tested this method and it works.

To get the terminal hidden, you need to select Run whether the user is logged on or not when creating the task. And in order to use that option, you need to run as Admin or you’d need to have Windows Pro or above so you can change your system’s security policy to allow normal user to use that option. Checking “Hidden” option will not work; it’s to hide the task from list view, I believe. If you run the task as Admin, you’d also need admin right to kill the task. A bit inconvenient.


nohup on WSL

Anyway, if you’re curious, I managed to get nohup tiddlywiki working by running the command inside my default GUI terminal, xfce4-terminal (with vcxsrv on Windows 10). I started the terminal directly with a shortcut I created. Otherwise, you’d need to follow the steps below:

  • start bash, cd to your node.js directory

  • then run:

    (xfce4-terminal &); exit   # this will open xfce4-terminal & then close the bash console
    
  • then you can run nohup tiddllywiki command inside the newly spawned terminal, eg:

    nohup ./node.exe node_modules/tiddlywiki/tiddlywiki.js mynewwiki --listen &
    
  • close the terminal when done. The node.exe ... process will remain running. The important thing here is to exit bash console first! If you close bash last, then tiddlywiki process will disappear.

xfce4-terminal is an additional pkg you’d need to install, and it requires X11 support. On Windows 10, you’d need to setup an X server such as vcxsrv. I believe WSL2 on Windows 11 comes with GUI support. But I don’t have a Windows 11 machine to test the whole thing.


Replace OverDrive content with linux binary zip (so you can share)

OK, I’ve not tested this, but in theory it should work; as long as nohup works as you’ve described. But then you lose the option to run node.js in Windows…

The last two options are probably overkill. I believe you should be able to get powershell shortcut or vbscript working, and they are probably the simplest.

So hope one of the suggestions works for you. Good luck!

1 Like

I already got this to work with the shortcut command:
powershell -windowstyle hidden ./tiddlywiki.cmd mynewwiki --listen
not sure why it didn’t work at my first try
looking at the other options too, thanks!
update: it seems that the .cmd extension for tiddlywiki that made it work

nohup ./node.exe node_modules/tiddlywiki/tiddlywiki.js mynewwiki --listen &
works from the WSL2 command line from within the node directory, no need to install xfce4-terminal,
great.
Since these generic solutions work, I need no specific solution like the VBScript.
Thank you, nice intel.
I knew that I would just need a different syntax for the nohup to work.
It seems that the install is correct for both Linux and Windows in OneDrive, just need more specific syntax for the path handling.

Hi, TidGi let you choose a folder to store all individual tiddlers, just like nodejs wiki.

What can TidGi do that Tiddlywiki on Node can’t?
Because this argument that TidGi unlike Tiddlywiki is cross platform, is not quite right, Tiddlywiki on Node is cross platform as it is, as you see we figured out that you need platform specific, and maybe higher specificity syntax to use it cross platorm, but it is cross platform already as it is.
How and why are the GitHub backup features of TidGi better than using it with node in the cloud / cloud backups?

Easiest way I think to get up and running on Windows is GitHub - OokTech/TW5-BobEXE: TiddlyWiki5 packaged with the Bob plugin in a single executable file. Now in a much more usable repo! Please don't put issues with Bob here, this is for the part that do the compiling. - the releases only go up to TiddlyWiki 5.2.3, it’s relatively easy to make your own release for Linux/MacOS/Windows for the current TW release. I’ve uploaded my version of 5.2.5 for Windows here:
Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

(understand if you don’t want to run it but might help someone!)

I have seen Bob, just don’t know how is it better than Tiddlywiki on node on the cloud.

It’s massively convenient.

… and offers multi user, multi wiki capabilities

Hi, TidGi is cross platform. And allow normal user to use nodejs wiki without using terminal and cli.

Many normal user don’t have an online server, they want the local-first TidGi.