Cannot find module '@napi-rs/simple-git-linux-x64-gnu'

Hi again 🙂 I'm trying to deploy a Nextjs project to Pages, a different one to my previous thread. However, this one fails because of the following error:
13:24:40.598 ▲ - info Linting and checking validity of types...
13:24:43.061 ▲ - info Creating an optimized production build...
13:24:45.133 ▲ unhandledRejection Error: Cannot find module '@napi-rs/simple-git-linux-x64-gnu'
13:24:45.133 ▲ Require stack:
13:24:45.133 ▲ - /opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js
13:24:45.134 ▲ at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
13:24:45.134 ▲ at /opt/buildhome/repo/node_modules/next/dist/server/require-hook.js:188:36
13:24:45.134 ▲ at Module._load (node:internal/modules/cjs/loader:920:27)
13:24:45.134 ▲ at Module.require (node:internal/modules/cjs/loader:1141:19)
13:24:45.134 ▲ at require (node:internal/modules/cjs/helpers:110:18)
13:24:45.134 ▲ at Object.<anonymous> (/opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js:174:31)
13:24:45.134 ▲ at Module._compile (node:internal/modules/cjs/loader:1254:14)
13:24:45.135 ▲ at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
13:24:45.135 ▲ at Module.load (node:internal/modules/cjs/loader:1117:32)
13:24:45.135 ▲ at Module._load (node:internal/modules/cjs/loader:958:12) {
13:24:45.135 ▲ code: 'MODULE_NOT_FOUND',
13:24:45.135 ▲ requireStack: [ '/opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js' ]
13:24:45.135 ▲ }
13:24:45.259 ▲ Error: Command "npm run build" exited with 1
13:24:40.598 ▲ - info Linting and checking validity of types...
13:24:43.061 ▲ - info Creating an optimized production build...
13:24:45.133 ▲ unhandledRejection Error: Cannot find module '@napi-rs/simple-git-linux-x64-gnu'
13:24:45.133 ▲ Require stack:
13:24:45.133 ▲ - /opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js
13:24:45.134 ▲ at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
13:24:45.134 ▲ at /opt/buildhome/repo/node_modules/next/dist/server/require-hook.js:188:36
13:24:45.134 ▲ at Module._load (node:internal/modules/cjs/loader:920:27)
13:24:45.134 ▲ at Module.require (node:internal/modules/cjs/loader:1141:19)
13:24:45.134 ▲ at require (node:internal/modules/cjs/helpers:110:18)
13:24:45.134 ▲ at Object.<anonymous> (/opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js:174:31)
13:24:45.134 ▲ at Module._compile (node:internal/modules/cjs/loader:1254:14)
13:24:45.135 ▲ at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
13:24:45.135 ▲ at Module.load (node:internal/modules/cjs/loader:1117:32)
13:24:45.135 ▲ at Module._load (node:internal/modules/cjs/loader:958:12) {
13:24:45.135 ▲ code: 'MODULE_NOT_FOUND',
13:24:45.135 ▲ requireStack: [ '/opt/buildhome/repo/node_modules/@napi-rs/simple-git/index.js' ]
13:24:45.135 ▲ }
13:24:45.259 ▲ Error: Command "npm run build" exited with 1
Locally, it builds fine but it doesn't on Pages. The repo is available here: https://github.com/spectate/docs Thanks!
GitHub
GitHub - spectate/docs: Platform documentation of Spectate.
Platform documentation of Spectate. Contribute to spectate/docs development by creating an account on GitHub.
5 Replies
Bjarn
Bjarn12mo ago
One note; this project deployed fine last time it did a deploy, which was still next-on-pages@0.10.2 I just can't seem to be able to get this project to deploy again. I have tried migrating to NPM, Yarn v3 and even installed the missing deps myself, no luck:
Bjarn
Bjarn12mo ago
Bjarn
Bjarn12mo ago
Using the beta build image, also tried the stable "v1" with no luck.
Bjarn
Bjarn12mo ago
also fails locally with next-on-pages here
Bjarn
Bjarn12mo ago
Wow, idk what it was tbh - latest commit fixed it. Reverted back to NPM and it magically works.