MWS Installation Errors

Has anyone managed to run MWS on a Windows machine without administrative privileges? I’m very excited to start playing with this if I can get it to work.

I have git running portably, and nodejs working portably (enough to run regular TiddlyWiki on Node). Following the instructions I got an error on the git clone command and some google suggested I could bypass the error with this command git config --global http.schannelCheckRevoke false. That let me get one step further.

Now I’m stuck here. Feels like this is going to be harder to bypass.

I’m a long time not-very-technical BOB user and grateful for the BOB.exe file as it meant I didn’t have to install any of this other stuff (and therefore didn’t need admin).

Anyone have any ideas?

Hi @stobot if I’m understanding the error trace correctly, the problem is with the installation of the npm module “better-sqlite3”, which is the binary module we use to work with the database.

The error log suggests that npm is failing to download the appropriate prebuilt, compiled version of the module for your architecture. This could happen perhaps if your machine is using an unusual processor, and so is not recognised by npm as a being compatible with an off-the-shelf build.

Thanks for the reply @jeremyruston - I’m using a standard HP laptop so don’t think there’s anything unusual about the machine (though could be wrong) other than I work at a GigantiCorp (to steal Scott’s wording :slight_smile:) company that locks things down.

image

I have another older model (also HP Laptop) at the office I’ll try this on also as it’s same security setup but different hardware.

I do have a large gaming laptop at home that this works fine on - but I don’t need TiddlyWiki on that one, I use TW for work, so hoping I can figure this out.

Is it somehow possible to replicate what Jed/BOB does by packing MWS in a .EXE version for those of us who don’t have easy git/node access maybe? Maybe eventually? That might not be my problem, but I still suspect security is getting in the way.

Just a wild guess: npm ERR! unable to get local issuer certificate [Solved] | bobbyhadz

Testing for valid SSL certificates is a security feature. NPM SSL certificates should not be invalid and SSL testing should never be deactivated.

I think it is blocked, because there is an other thread running, that locks some files in the node_modules directory. Are you sure you did end all your TW servers. Windows sometimes even locks directories if a file browser shows previews in a directory.

So I would end all TW servers, restart the PC and try npm install again.

Thanks @CodaCoder & @pmario - I think those comments pertain to the git clone step which I did get past, but just in case I’ve now run the npm config set strict-ssl false command just to see if that fixed anything. I agree Mario that these seem like things I don’t want to leave on long-term, but I’m just trying to see if it’s at all possible to get MWS up and running.

After deleting everything, restarting, and trying again, I get the same results.

In case it’s helpful, I’ve attached both my command line screen and the log that it tells me to refer to.

Command Line.tid (12.7 KB)
Debug Log.tid (23.0 KB)

It seems you do not have python language installed. It is needed to build the sqlite node native extension, when MWS is installed.

Thanks @pmario, installed Python…

image

and have fewer errors, but still the errors start in the same place.

Command Line After Python.tid (4.3 KB)

Where did you get the portable versions from?

This page: https://weekendprojects.dev/posts/how-to-fix-npm-install-failed-to-remove-some-directories/#clear-npm-cache suggest to clear the npm cache. (No need to use yarn. npm should do)

NPM docs: npm-cache | npm Docs

npm cache clean –force

Was worth a try. I have been fully deleting and using new folders on each attempt, but this time did that PLUS your suggested command npm cache clean -force

I now suspect that my problem has to do with running node or git in a portable fashion - even with my set PATH commands.

Going back to a previous question, is there any possibility of a mechanism similar to BOB.exe where a Windows user isn’t required to install Node/Git/Python to run MWS?

If I understand it correctly there may eventually be a zip file of content you unzip and launch the server, but this kind of deployment has not yet being prepared, and for know only the github build will work until then.

  • Speaking from a position of foggy memory not knowledge.
  • Bob.exe seems to work like an executable zip the first time.

Sounds like without admin privileges, I’m just out of luck until a different install / run process is developed. If anyone finds this to be not true, please let me know. Thanks to those who weighed in and tried to help. It’s a shame because regular Node isn’t a problem, just MWS.

I sent my logs into ChatGPT to see what it thought, and it spit out the below, which seemily confirmed my worries.

The errors you’re encountering during the npm install process suggest permission issues as well as problems related to the specific package (better-sqlite3) and the Node.js environment setup. Here’s a breakdown of the potential issues and steps to resolve them:

Key Issues:

  1. EPERM (Error: Permission denied):

    • This is related to the rmdir operation failing due to permission issues. It’s common in Windows when some files or directories are locked by another process or when there are restrictions on the user’s account.
  2. Node-gyp build failure:

    • The package better-sqlite3 relies on native modules, which require compilation. For this, node-gyp needs to compile C++ code, and it often requires additional system tools like Python, a C++ compiler, and sometimes administrator access, which might be problematic with portable Node.js setups.

Hi @stobot it seems as though the fact that better-sqlite3 is a native module is causing the problem. There may be a workaround to avoid using better-sqlite3 and instead use node-sqlite3-wasm which is a pure JS implementation of SQLite3, but requires WASM support which doesn’t work on older versions of Node.js. If your implementation of Node.js can’t handle native modules there’s a reasonable chance that it can’t handle WASM, but it may be worth trying.

  1. In your wiki, create a tiddler $:/config/MultiWikiServer/Engine and set the text to “wasm”
  2. Instead of running npm install on its own, explicitly install node-sqlite3-wasm with npm install node-sqlite3-wasm

Thanks @jeremyruston, tried to interpret the instructions and didn’t have success, but worry I missed a piece. Your step 1 says “In your wiki create”… but doesn’t the install go before getting to a wiki in which to create something? Maybe I’m more confused than I thought. My best guess was to just go onto TiddlyWiki.com, create a tiddler with that name and text value, do an “export to .tid” to my desktop, and put that in the folder \tiddlywiki5\core\wiki, the only subfolder I saw with .tid files in it.

Then I ran the npm install node-sqlite3-wasm but looking at the log, it still seemed to reference better-sqlite3 so maybe I just did it wrong. I’ve attached the whole console log

Command Long 2024-09-24.tid (5.4 KB)
$__config_MultiWikiServer_Engine.tid (107 Bytes)

This looks like a permissions issue, maybe npm install --unsafe-perm is help for you

For me, node16 had a build error when installing sqlite. I switched node to 20.12, ran npm runbuild, and everything was fine.