[Vuejs]-Vue 2 build with docker – sh: vue-cli-service: not found

1👍

Are you using volumes for your app service in your docker-compose file?

I got a similar error on Vue.js 2 with Docker npm run serve was failing because the node_modules repository went missing in the Docker container. The root cause of it was that I am using bind mounts to allow code hot reload in my development environment, which made Docker overwrite the node_modules repository after running npm install -g @vue/cli, which explains that cli couldn’t be found.

I solved this by using a volume for the node_modules repository, as explained by this answer.

👤Isa

Leave a comment