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

Can't build Docker image #91

Open
bubblesnout opened this issue Jun 18, 2024 · 2 comments
Open

Can't build Docker image #91

bubblesnout opened this issue Jun 18, 2024 · 2 comments

Comments

@bubblesnout
Copy link

bubblesnout commented Jun 18, 2024

I'm trying to build a Docker image by using the included docker-compose.yml file, but on step 5/6 I get the following. Am I doing something wrong or is there a fix that needs to be made somewhere?

`
=> ERROR [5/6] RUN npm run build 17.1s

[5/6] RUN npm run build:
#0 6.766
#0 6.766 > [email protected] build /usr/src/node-app
#0 6.766 > react-scripts build && rm -rf release/public && mkdir release/public && mv -v build/* ./release/public && cp release/public/index.html release/public/login.html
#0 6.766
#0 15.78 internal/modules/cjs/loader.js:934
#0 15.78 throw err;
#0 15.78 ^
#0 15.78
#0 15.78 Error: Cannot find module 'ajv/dist/compile/codegen'
#0 15.78 Require stack:
#0 15.78 - /usr/src/node-app/node_modules/ajv-keywords/dist/definitions/typeof.js
#0 15.78 - /usr/src/node-app/node_modules/ajv-keywords/dist/keywords/typeof.js
#0 15.78 - /usr/src/node-app/node_modules/ajv-keywords/dist/keywords/index.js
#0 15.78 - /usr/src/node-app/node_modules/ajv-keywords/dist/index.js
#0 15.78 - /usr/src/node-app/node_modules/schema-utils/dist/validate.js
#0 15.78 - /usr/src/node-app/node_modules/schema-utils/dist/index.js
#0 15.78 - /usr/src/node-app/node_modules/mini-css-extract-plugin/dist/index.js
#0 15.78 - /usr/src/node-app/node_modules/react-scripts/config/webpack.config.js
#0 15.78 - /usr/src/node-app/node_modules/react-scripts/scripts/build.js
#0 15.78 at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
#0 15.78 at Function.Module._load (internal/modules/cjs/loader.js:774:27)
#0 15.78 at Module.require (internal/modules/cjs/loader.js:1003:19)
#0 15.78 at require (internal/modules/cjs/helpers.js:107:18)
#0 15.78 at Object. (/usr/src/node-app/node_modules/ajv-keywords/dist/definitions/typeof.js:3:19)
#0 15.78 at Module._compile (internal/modules/cjs/loader.js:1114:14)
#0 15.78 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
#0 15.78 at Module.load (internal/modules/cjs/loader.js:979:32)
#0 15.78 at Function.Module._load (internal/modules/cjs/loader.js:819:12)
#0 15.78 at Module.require (internal/modules/cjs/loader.js:1003:19) {
#0 15.78 code: 'MODULE_NOT_FOUND',
#0 15.78 requireStack: [
#0 15.78 '/usr/src/node-app/node_modules/ajv-keywords/dist/definitions/typeof.js',
#0 15.78 '/usr/src/node-app/node_modules/ajv-keywords/dist/keywords/typeof.js',
#0 15.78 '/usr/src/node-app/node_modules/ajv-keywords/dist/keywords/index.js',
#0 15.78 '/usr/src/node-app/node_modules/ajv-keywords/dist/index.js',
#0 15.78 '/usr/src/node-app/node_modules/schema-utils/dist/validate.js',
#0 15.78 '/usr/src/node-app/node_modules/schema-utils/dist/index.js',
#0 15.78 '/usr/src/node-app/node_modules/mini-css-extract-plugin/dist/index.js',
#0 15.78 '/usr/src/node-app/node_modules/react-scripts/config/webpack.config.js',
#0 15.78 '/usr/src/node-app/node_modules/react-scripts/scripts/build.js'
#0 15.78 ]
#0 15.78 }
#0 15.84 npm ERR! code ELIFECYCLE
#0 15.84 npm ERR! errno 1
#0 15.86 npm ERR! [email protected] build: react-scripts build && rm -rf release/public && mkdir release/public && mv -v build/* ./release/public && cp release/public/index.html release/public/login.html
#0 15.86 npm ERR! Exit status 1
#0 15.86 npm ERR!
#0 15.86 npm ERR! Failed at the [email protected] build script.
#0 15.86 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#0 16.00
#0 16.00 npm ERR! A complete log of this run can be found in:
#0 16.00 npm ERR! /root/.npm/_logs/2024-06-18T06_27_05_234Z-debug.log


failed to solve: executor failed running [/bin/sh -c npm run build]: exit code: 1
`

@bubblesnout
Copy link
Author

FYI I was able to work around this by adding the following in to the dependencies in the package.json file:

"ajv": "8.8.2"

@punkfairie
Copy link

This fixed it for me too thank you!!!

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