Failed to find 'vue-cli-service' command in linux container on win 10 host
See original GitHub issueVersion
3.4.1
Environment info
Linux container on windows 10 host
Steps to reproduce
docker file
FROM node:latest
#ARG NODE_ENV
#ENV NODE_ENV=dev
ENV CONTAINER_PATH /var/www/myapp
WORKDIR $CONTAINER_PATH
COPY package*.json ./
# # install project dependencies
#RUN npm install -g @vue/cli-service-global
RUN npm install
#RUN yarn
EXPOSE 8080
# Start the app
CMD npm run serve
docker-compose.yml
version: '3'
services:
web:
container_name: myapp
image: myapp
build:
context: .
dockerfile: .docker/node.development.dockerfile
volumes:
- .:/var/www/myapp
ports:
- "8080:8080"
What is expected?
when i run the app locally, vue-cli-service serve
works. it should work in container as well
What is actually happening?
vue-cli-service command not found
“@vue/cli-service”: “^3.4.1”, is part of dev-dependency
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to solve 'vue-cli-service' is not recognized as an internal ...
I think you are using cmd in windows. Try deleting the node_modules folder and after that run npm i from the cmd.
Read more >Installing and working with the devcontainer CLI
This topic covers the development container command-line interface (dev container CLI), which allows you to build and manage development containers, ...
Read more >Dockerizing a Vue.js application - Shekhar Gulati
To build the Docker image, please run the following command. 1. docker build -t myapp . Now, you can ...
Read more >Get started with Vuetify
This command will make changes to your project template files, components folder, vue.config.js, etc. If you are installing Vuetify via ...
Read more >Docker VueJS Example | DevOps Junction
Docker VueJS Example · Step 1: Creating a Dockerfile · Step 2: Build a Docker Vue JS Image using Dockerfile · Step 3:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem lies in your dockerfile
COPY . .
before serving the app. So the project files were not added to the container…vue-cli-service
is a project local command residing innode_modules/.bin
so you need to run it withnpx vue-cli-service serve
ornpm run serve
CMD
:CMD ["npm", "run", "serve"]
NODE_ENV
in your environment (https://cli.vuejs.org/guide/mode-and-env.html#modes) . Even if you do need, we usedevelopment
rather thandev
for dev builds.node_modules
to the host by adding this to thedocker-compose.yml
:Here’s the full updated
docker-compse.yml
:dockerfile:
@Rocking80 This StackOverflow post explains it well: https://stackoverflow.com/a/32785014/2302258