nicholas-ochoa/OpenSC2K

Error at launch (in web console) (Using windows)

vasilvestre opened this issue · 20 comments

Here the error :
Uncaught Error: Une routine d'initialisation d'une bibliothèque de liens dynamiques (DLL) a échoué. \\?\C:\OpenSC2K\node_modules\better-sqlite3\build\Release\better_sqlite3.node at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:172:20) at Object.Module._extensions..node (module.js:598:18) at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:172:20) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at bindings (C:\OpenSC2K\node_modules\bindings\bindings.js:81:44) at Object.<anonymous> (C:\OpenSC2K\node_modules\better-sqlite3\lib\database.js:4:40)

Please read the README.

Its there for a reason.

Well I did. And it doesn't work...

See issue #4 for solution.

What output do you get after running Step 5. Can you try removing the OpenSC2K directory, cloning again and then running the commands and posting the output of each? Maybe something's going wrong during installation that we haven't seen yet.

Full log here :
https://pastebin.com/B6r1AAJG

(can't copy here because of simple quote breaking style)

Npm version : 5.6.0

It looks like you missed a step between npm install and npm start.

node_modules/.bin/electron-rebuild -f -w better-sqlite3

Does the node_modules/.bin directory exist?

Try

node_modules\.bin\electron-rebuild -f -w better-sqlite3

It looks like you're having a syntax error when you type it into CMD. If the above command doesn't work try using Git Bash (should have been installed when you installed git on your computer, it's a standalone executable that gives you a bash prompt rather than a windows prompt)

node_modules exist, and I use Cmder with git bash

Git bash wouldn't respond with that type of error - it would simply say

$ node_modules
bash: node_modules: command not found

You aren't using the right type of slashes, you are using forward slash, not back slash (windows FS uses back slashes). The prompt thinks you are trying to execute something called node_modules, try replacing all forward slashes with back slashes.

cdubz commented

Note the directory separator with this command. On Windows it needs to be as @cursorial provides it above (\). Otherwise you’ll get the “node_modules unknown” error because Windows thinks you are asking for an executable as opposed to a folder.

I was trying not to be too verbose with the install instructions in the README, but perhaps there should be a separate list of steps for Windows to avoid this confusion...

Look at my pastebin, I use backslash..

cdubz commented

This line makes it sound like the Windows build tools are not being found:

MSBUILD : error MSB4132: La version des outils "2.0" n'est pas reconnue. Les versions disponibles sont "14.0", "4.0".

Perhaps wipe out node_modules and run through the install steps again? I think I had a similar issue when I ran a failed npm install the very first time.

I FIXED IT !
Thanks to chjj/pty.js#60

open up a new cmd as administrator and run this command: npm install --global --production windows-build-tools then npm config set msvs_version 2015 --global close all instances of shell/cmd, reopen a cmd (regular this time, non-administrator) return to your directory where you are trying to run npm install and run it again

I also installed https://www.microsoft.com/en-us/download/details.aspx?id=40760 but I don't think it helped.
Add to README that windows users (at least) need to restart a cmd without admin to rebuild :)

I was just about to comment with that command - well done.

This should be added to the README after where windows-build-tools is installed

  • Run this

      npm config set msvs_version 2015 --global
    
  • Close all instances of shell/cmd, reopen a CMD (non-admin), return to the OpenSC2K directory and run the following

      npm install
    
cdubz commented

Curious. I wonder why I haven't had that same requirement for the two Windows installs I have done...

@cdubz Maybe your node installation was already configured to use that version of msvs - hard to tell.

@vasilvestre @rage8885 This issue can be closed now.