I developed my NestJS application on my local MacBook Air M1. I built the app and copied the built files and folders + node_modules to the production server which is running Windows Server 2019 Standard. The production server does not have internet access for installing modules using for example yarn install command. When I try to run the application I get the following error:
C:\myproject\api>node main.js
internal/modules/cjs/loader.js:1122
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: \\?\C:\myproject\api\node_modules\argon2\lib\binding\napi-v3\argon2.node ist keine zulässige Win32-Anwendung.
\\?\C:\myproject\api\node_modules\argon2\lib\binding\napi-v3\argon2.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\myproject\api\node_modules\argon2\argon2.js:12:5)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\tubs\api\main.js:7444:18)
at __webpack_require__ (C:\tubs\api\main.js:20:30)
at Object.<anonymous> (C:\tubs\api\main.js:7355:16)
at __webpack_require__ (C:\tubs\api\main.js:20:30)
I have "argon2": "^0.28.5" in my package.json file for password encryption. I googled a lot but didn't see any similar issue.
just downgrade argon2 to older version, such as 0.28.4