GrottoCenter / grottocenter-api

Grottocenter API
https://api.grottocenter.org
GNU Affero General Public License v3.0
15 stars 2 forks source link

Package cleaning and update #1221

Closed vmarseguerra closed 1 year ago

vmarseguerra commented 1 year ago

Changes:

Clm-Roig commented 1 year ago

I have an issue. I started a fresh installation, totally from scratch. Here is my setup:

I ran :

npm install      # OK
npm run dev:up   # OK
npm run dev   # <--- ISSUE HERE /!\

The error is about argon2 :

error: Error: Attempted to `require('D:\dev\grottocenter-api\api\services\AuthService.js')`, but an error occurred:
Error: Cannot find module 'D:\dev\grottocenter-api\node_modules\argon2\lib\binding\napi-v3\argon2.node'

The /lib folder doesn't exist in this module. I'm currently searching for more information.

vmarseguerra commented 1 year ago

Weird, I have the same version of OS, NodeJs and NPM but no problem. A new clone of this branch installs and runs fine

Argon2 is the package used for password-hashing, it contain a native binary For Windows the precompiled binary is downloaded from: https://github.com/ranisalt/node-argon2/releases/download/v0.30.3/argon2-v0.30.3-napi-v3-win32-x64-unknown.tar.gz Then it is decompressed like the following: image

Clm-Roig commented 1 year ago

I rebuilt the binaries of argon2 as explained here, using npx @mapbox/node-pre-gyp rebuild -C ./node_modules/argon2 (I had to install Python 3 and VSCode C++ tools). It's now working 🥳