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

Was compiled against a different Node.js version using NODE_MODULE_VERSION 115. This version of Node.js requires NODE_MODULE_VERSION 93 #390

Open
gilliamwells opened this issue Jul 23, 2024 · 13 comments

Comments

@gilliamwells
Copy link

I am experiencing issues with my local build on MacOS:
The module '/node_modules/muhammara/binding/muhammara.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 115. This version of Node.js requires NODE_MODULE_VERSION 93.

I tried everything mentioned in #374 with no success.

Running Node 20.15.1 & NPM 10.7.0
Not using Electron

@julianhille
Copy link
Owner

julianhille commented Jul 23, 2024

let me know what are you trying to do:

  • where / how are you building / packaging (architecture, os, system [github? aws? local? docker?])
  • where do you install it? how? (architecture, os, system [github? aws? local? docker?])
  • using electron?

@gilliamwells
Copy link
Author

gilliamwells commented Jul 23, 2024

@julianhille not using electron. Building locally using Nuxt 2/VueJS 2 on MacOS, deploying to Google Cloud using GitHub Actions and AppEngine.

Builds successfully when using Node v16 or v18 but fails at v20.

I need to use Node v20.x due to Google Cloud deployment restrictions as of today.

@julianhille
Copy link
Owner

Make sure you are building in GitHub actions with node 20. It seems you are building with version 16.0.0 there. Is your GitHub actions publicly available?

@gilliamwells
Copy link
Author

GitHub Actions are not public, but I'm building locally from my IDE using Node v20 in this case.

@julianhille
Copy link
Owner

But if you build and deploy from GitHub you need to make sure you build with v20 there. Can you add an excerpt of you action without leaking something? Like the build and deploy steps. Just to get a grasp on it and to not miss anything and or to remove maybe misunderstandings what your process is

@gilliamwells
Copy link
Author

I'm including the GitHub Actions script below, but I know it's related to the issue. This was deploying successfully for months until I updated the minimum node version in my package.json to 20. NPM install runs all successfully.

name: Dev Env Deploy

on:
workflow_dispatch:
push:
branches:
- dev

jobs:
deploy:
runs-on: ubuntu-latest
environment: dev

steps:
  - name: Checkout code
    uses: actions/checkout@v3

  - name: GCP Auth
    uses: google-github-actions/auth@v1
    with:
      credentials_json: '${{ secrets.GCP_SA_KEY }}'

  - name: Set up Google Cloud SDK
    uses: google-github-actions/setup-gcloud@v1

  - name: Update Components
    run: |
      gcloud components update

  - name: write the bucket service account secret
    run: 'echo "$BUCKET_KEYFILE" > gcp-settings.json'
    shell: bash
    env:
      BUCKET_KEYFILE: ${{ secrets.BUCKET_KEYFILE }}

  - name: Deploy to App Engine
    uses: google-github-actions/deploy-appengine@v1
    env:
      CLOUDSDK_APP_CLOUD_BUILD_TIMEOUT: 1800 # 30 minutes
    with:
      version: v${{ github.run_id }}-${{ github.run_attempt }}
      env_vars: |-
        APP_VERSION=${{ github.run_id }}-${{ github.run_attempt }}
        APP_URL=${{ vars.APP_URL }}
        APP_RLPA_URL=${{ vars.APP_RLPA_URL }}
        BUCKET_PROJECTID=${{ secrets.BUCKET_PROJECTID }}
        BUCKET_ATTACHMENTBUCKET=${{ vars.BUCKET_ATTACHMENTBUCKET }}
        BUCKET_AVATARSBUCKET=${{ vars.BUCKET_AVATARSBUCKET }}
        BUCKET_DELETEDBUCKET=${{ vars.BUCKET_DELETEDBUCKET }}
        COUNTYCALC_URL=${{ vars.COUNTYCALC_URL }}
        COUNTYCALC_SECRET_KEY=${{ secrets.COUNTYCALC_SECRET_KEY }}
        GOOGLE_ANALYTICS_ID=${{ vars.GOOGLE_ANALYTICS_ID }}
        JWT_PRIVATE_KEY=${{ secrets.JWT_PRIVATE_KEY }}
        MAILGUN_KEY=${{ secrets.MAILGUN_KEY }}
        MAILGUN_DOMAIN=${{ vars.MAILGUN_DOMAIN }}
        MAILGUN_FROM=${{ vars.MAILGUN_FROM }}
        MAILGUN_REPLYTO=${{ vars.MAILGUN_REPLYTO }}
        MONGO_URL=${{ secrets.MONGO_URL }}
        SENTRY_DSN=${{ vars.SENTRY_DSN }}
        STRIPE_SECRET_KEY=${{ secrets.STRIPE_SECRET_KEY }}
        DD_CLIENT_TOKEN=${{ vars.DD_CLIENT_TOKEN }}
        DD_API_KEY=${{ secrets.DD_API_KEY }}
        DD_SITE=${{ vars.DD_SITE }}
        DD_APP_ID=${{ vars.DD_APP_ID }}
        DD_SERVICE=${{ vars.DD_SERVICE }}
        DD_ENV=${{ vars.DD_ENV }}
        DD_TRACE_AGENT_PORT=${{ vars.DD_TRACE_AGENT_PORT }}

@gilliamwells
Copy link
Author

@julianhille to clarify - after I build locally and attempt to run the app locally, that's when it fails, i.e. attempting to make it run on localhost:8080, I get the following:

Error: The module '/Users/briantessier/PhpstormProjects/Bundle_original/node_modules/muhammara/binding/muhammara.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 115. This version of Node.js requires NODE_MODULE_VERSION 93. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install). at Object.Module._extensions..node (node:internal/modules/cjs/loader:1282:18) at Module.load (node:internal/modules/cjs/loader:1076:32) at Function.Module._load (node:internal/modules/cjs/loader:911:12) at Module.require (node:internal/modules/cjs/loader:1100:19) at require (node:internal/modules/cjs/helpers:108:18) at Object. (/Users/briantessier/PhpstormProjects/Bundle_original/node_modules/muhammara/lib/muhammara.js:6:35) at Module._compile (node:internal/modules/cjs/loader:1198:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10) at Module.load (node:internal/modules/cjs/loader:1076:32) at Function.Module._load (node:internal/modules/cjs/loader:911:12)

@julianhille
Copy link
Owner

Ahh. Ok. Got it. It already fails locally. My bad. Thought it fails on the deployed system. Interesting. Can you try to add something like "node --version" into the npm install step? Just to make sure.

Also please hash the muhammara.node binary with Sha or so add the result here after you did an npm install.

@julianhille
Copy link
Owner

Please also try:

npm install Muhammad --build-from-source

Not sure if command is correct. Will take some time.

@gilliamwells
Copy link
Author

The SHA sum is: 289c05fb4c9c23dde8485142131bf2f28935a4af4c7b0699ef1f0282027ef3a2 muhammara.node
I tried both suggestions and it's still giving me the same issue.

@julianhille
Copy link
Owner

Please also try:

npm install Muhammad --build-from-source

Not sure if command is correct. Will take some time.

@gilliamwells
Copy link
Author

@julianhille Muhammad is the wrong name for sure - but I did that muhammara and am getting the same results.

@julianhille
Copy link
Owner

did it compile? can you add log?

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

No branches or pull requests

2 participants