<#472 pact-core@14.0.5: Failed to find native modu...
# pact-js-development
g
#472 pact-core@14.0.5: Failed to find native module for linux-arm64 Issue created by fbarril I am getting the following error running inside a docker container on a mac m1.
[03:01:45.022] ERROR (361): pact-core@14.0.5: Failed to find native module for linux-arm64: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel')
Copy code
const messagePact = new MessageConsumerPact({
        consumer: 'a.b-service-i',
        provider: 'a.b-provider',
        pactfileWriteMode: 'update', 
        logLevel: 'trace', 
    })
I can provide more info if necessary. Software versions • OS: _e.g. Mac OS sonoma 14.2.1 • Pact Node version: _e.g. Pact Node v12.1.1 • Node Version:
v16.20.2
Issue Checklist Please confirm the following: ☑︎ I have upgraded to the latest ☑︎ I have the read the FAQs in the Readme ☑︎ I have triple checked, that there are no unhandled promises in my code ☑︎ I have set my log level to debug and attached a log file showing the complete request/response cycle ☐ For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem Expected behaviour Tests running Actual behaviour Test breaking trying to create
MessageConsumerPact
Steps to reproduce Follow the pact-js-workshop tutorial on a mac m1. Relevant log files
Copy code
[03:01:23.659] ERROR (337): pact-core@14.0.5: Failed to find native module for linux-arm64: TypeError: Cannot read properties of undefined (reading 'pactffiInitWithLogLevel')

Error: Failed to load native module, try setting LOG_LEVEL=debug for more info
    at initialiseFfi (/home/node/app/node_modules/@pact-foundation/pact-core/src/ffi/index.js:99:15)
    at getFfiLib (/home/node/app/node_modules/@pact-foundation/pact-core/src/ffi/index.js:106:15)
    at makeConsumerMessagePact (/home/node/app/node_modules/@pact-foundation/pact-core/src/consumer/index.js:127:37)
    at new MessageConsumerPact (/home/node/app/node_modules/@pact-foundation/pact/src/messageConsumerPact.js:57:66)
    at Suite.<anonymous> (/home/node/app/test/contract/patientCreated.test.js:10:25)
    at Object.create (/home/node/app/node_modules/mocha/lib/interfaces/common.js:148:19)
    at Object.only (/home/node/app/node_modules/mocha/lib/interfaces/common.js:106:21)
    at Function.context.describe.only (/home/node/app/node_modules/mocha/lib/interfaces/bdd.js:69:27)
    at Object.<anonymous> (/home/node/app/test/contract/patientCreated.test.js:9:10)
    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)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
    at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
    at async formattedImport (/home/node/app/node_modules/mocha/lib/nodejs/esm-utils.js:7:14)
    at async Object.exports.requireOrImport (/home/node/app/node_modules/mocha/lib/nodejs/esm-utils.js:38:28)
    at async Object.exports.loadFilesAsync (/home/node/app/node_modules/mocha/lib/nodejs/esm-utils.js:91:20)
    at async singleRun (/home/node/app/node_modules/mocha/lib/cli/run-helpers.js:125:3)
    at async Object.exports.handler (/home/node/app/node_modules/mocha/lib/cli/run.js:370:5)
pact-foundation/pact-js-core