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

No build script in package.json causing execution errrors in command line and Dockerfile #73

Open
HowieG opened this issue Aug 5, 2023 · 0 comments

Comments

@HowieG
Copy link

HowieG commented Aug 5, 2023

"scripts": { "watch:chrome": "webpack --config webpack/webpack.chrome.dev.js --watch", "build:chrome": "webpack --config webpack/webpack.chrome.prod.js", "watch:firefox": "webpack --config webpack/webpack.firefox.dev.js --watch", "build:firefox": "webpack --config webpack/webpack.firefox.prod.js", "watch:figma": "webpack --config webpack/webpack.figma.dev.js --watch", "build:figma": "webpack --config webpack/webpack.figma.prod.js" },

The above has no "build" script. So when you run npm run build from the README you get an error npm ERR! Missing script: "build". And when you run docker build -t segment-anything . you get the same error because the Dockerfile runs npm run build

The obvious quick fix is to rename your browser of choice to build:

"scripts": { "watch": "webpack --config webpack/webpack.chrome.dev.js --watch", "build": "webpack --config webpack/webpack.chrome.prod.js", "watch:firefox": "webpack --config webpack/webpack.firefox.dev.js --watch", "build:firefox": "webpack --config webpack/webpack.firefox.prod.js", "watch:figma": "webpack --config webpack/webpack.figma.dev.js --watch", "build:figma": "webpack --config webpack/webpack.figma.prod.js" },

But I'm wondering if there's a more elegant solution? Like mapping build to build:chrome for instance on initial setup.

Sorry if anything I said is imprecise or there's an obvious solution, I'm new to a lot of these tools

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

1 participant