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

missing script "build" #1311

Open
madelacerda opened this issue Dec 13, 2023 · 5 comments
Open

missing script "build" #1311

madelacerda opened this issue Dec 13, 2023 · 5 comments

Comments

@madelacerda
Copy link

madelacerda commented Dec 13, 2023

hello all!

i just downlaoded this template to work on a node project for shopify but when im trying to build the docker image to deploy this project into our services on AWS, im getting the error that there is no script for the build command inside my package.
and after checking the package inside the front there is no build command, so why the dockerfile uses that command on the line: RUN cd frontend && npm install && npm run build?

  • @shopify/shopify-app-express version: 2.1.3
  • Node version: 18
  • Operating system: windows 11
// Paste any relevant logs here
1.907 npm ERR! Missing script: "build"
1.907 npm ERR!
1.908 npm ERR! To see a list of scripts, run:
1.908 npm ERR!   npm run
1.910
1.910 npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-12-13T20_37_53_347Z-debug-0.log
------
Dockerfile:9
--------------------
   7 |     COPY web .
   8 |     RUN npm install
   9 | >>> RUN cd frontend && npm install && npm run build
  10 |     CMD ["npm", "run", "serve"]
  11 |
--------------------
ERROR: failed to solve: process "/bin/sh -c cd frontend && npm install && npm run build" did not complete successfully: exit code: 1

Expected behavior

build the docker image

Actual behavior

error on building image

Steps to reproduce the problem

  1. run docker build
@matteodepalo
Copy link

Hi @madelacerda, what is the content of package.json inside frontend?

@madelacerda
Copy link
Author

Hi @matteodepalo ! my package.json looks like this:
{
"name": "shopify-app-template-node",
"version": "1.0.0",
"private": true,
"license": "UNLICENSED",
"scripts": {
"debug": "node --inspect-brk index.js",
"dev": "cross-env NODE_ENV=development nodemon index.js --ignore ./frontend",
"serve": "cross-env NODE_ENV=production node index.js"
},
"type": "module",
"engines": {
"node": ">=14.13.1"
},
"dependencies": {
"@shopify/shopify-app-express": "^2.1.3",
"@shopify/shopify-app-session-storage-sqlite": "^1.2.3",
"compression": "^1.7.4",
"cross-env": "^7.0.3",
"serve-static": "^1.14.1"
},
"devDependencies": {
"nodemon": "^2.0.15",
"prettier": "^2.6.2",
"pretty-quick": "^3.1.3"
}
}

@matteodepalo
Copy link

That seems to be the package.json inside web, but what about web/frontend? I see in the Dockerfile we copy web in . so frontend should become something you can cd into.

@madelacerda
Copy link
Author

That seems to be the package.json inside web, but what about web/frontend? I see in the Dockerfile we copy web in . so frontend should become something you can cd into.

inside my web frontend there is no package, i just added there a index.html with an iframe, i just wanna build the docker image for this node project so we can deploy it in AWS, but im having this issue with the dockerfile.
because right now i have 2 package.json one on the root of the project and the one insisde web

@matteodepalo
Copy link

What about trying to change the Dockerfile to not cd into frontend and simply call build at the top level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants