Daniel Pereira
Daniel Pereira

Reputation: 495

docker-compose with vue-cli not working

I tried uploading my docker-compose with vue and every time I get that error. I think it's bashrc, but I did not understand where to put the bashrc in the ebiven / vue-cli docker hub.

Below is the information for you to help me:

The error log:

Attaching to teste2_web_1
web_1  |
web_1  | > [email protected] dev /code
web_1  | > node build/dev-server.js
web_1  |
web_1  | module.js:549
web_1  |     throw err;
web_1  |     ^
web_1  |
web_1  | Error: Cannot find module 'chalk'
web_1  |     at Function.Module._resolveFilename (module.js:547:15)
web_1  |     at Function.Module._load (module.js:474:25)
web_1  |     at Module.require (module.js:596:17)
web_1  |     at require (internal/module.js:11:18)
web_1  |     at Object.<anonymous> (/code/build/check-versions.js:1:75)
web_1  |     at Module._compile (module.js:652:30)
web_1  |     at Object.Module._extensions..js (module.js:663:10)
web_1  |     at Module.load (module.js:565:32)
web_1  |     at tryModuleLoad (module.js:505:12)
web_1  |     at Function.Module._load (module.js:497:3)
web_1  | npm ERR! code ELIFECYCLE
web_1  | npm ERR! errno 1
web_1  | npm ERR! [email protected] dev: `node build/dev-server.js`
web_1  | npm ERR! Exit status 1
web_1  | npm ERR!
web_1  | npm ERR! Failed at the [email protected] dev script.
web_1  | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
web_1  | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
web_1  |
web_1  | npm ERR! A complete log of this run can be found in:
web_1  | npm ERR!     /root/.npm/_logs/2018-06-08T13_02_10_155Z-debug.log
teste2_web_1 exited with code 1

My docker-compose:

version: '3'
services:
  web:
    image: ebiven/vue-cli
    command: npm run dev
    volumes:
      - /c/Users/Youssef/Documents/curso/teste2:/code
    ports:
      - "8080:8080"

My folder:

enter image description here

Upvotes: 1

Views: 2057

Answers (1)

Necevil
Necevil

Reputation: 2912

From the error it looks like you haven't run

Npm install

From your repo root directory. I also didn't see a node_modules directory in the screenshot you added in your question.

This specific error is coming from your app not being able to find the Chalk module which only functions to highlight the console output to your terminal in different colors.

Ie. it's not a mission critical piece so probably it's not a huge problem you are dealing with.

Double check your modules and run npm install again and it may just work!

Upvotes: 2

Related Questions