Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package cleaning and update #1221

Merged
merged 2 commits into from
Jul 19, 2023
Merged

Package cleaning and update #1221

merged 2 commits into from
Jul 19, 2023

Conversation

vmarseguerra
Copy link
Contributor

Changes:

  • Update development setup:
    • Add a script start/stop all development containers: npm run dev:up and npm run dev:down
    • The main NodeJS app is no more inside a container (less overhead, no more file permission issue)
  • Update README Installation and usage instructions
  • Integrate prettier into eslint (like in grottocenter-front):
    • Only one command to lint the code
    • Prettier will run during pre-commit check
  • Remove unused packages
  • Remove old or unused files
  • Disable Grunt integration in Sails
  • Use NodeJS version 20

@vmarseguerra vmarseguerra temporarily deployed to build July 16, 2023 15:01 — with GitHub Actions Inactive
@Clm-Roig
Copy link
Member

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

  • Windows 10
  • node v20.4.0
  • npm v9.7.2
  • docker v20.10.21
  • docker-compose v2.13.0

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
Copy link
Contributor Author

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

  • Is there any errors during the NPM install ?
  • Files permission issues ?
  • Custom NPM configuration ?

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
Copy link
Member

Clm-Roig commented Jul 19, 2023

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 🥳

@Clm-Roig Clm-Roig temporarily deployed to build July 19, 2023 08:04 — with GitHub Actions Inactive
@@ -3,6 +3,8 @@ version: '3.3'
# Date: Feb 13 2021
# Requirement: docker, docker-compose

name: grottocenter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vmarseguerra I added this to display an appropriate name in Docker Desktop (when not specified, it's just "docker" and I don't know which "docker" is which when I'm working on various projects):
docker name

@vmarseguerra vmarseguerra merged commit 4508d02 into develop Jul 19, 2023
3 checks passed
@vmarseguerra vmarseguerra deleted the package-cleaning branch July 19, 2023 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants