Giter Club home page Giter Club logo

dockerized's Issues

Running on Windows - no such file or directory, open '/usr/src/app/package.json'

Thanks a lot Kumar for your tutorial.
I am fairly new to Docker and encounter some issues to browse the website.
I am running docker on my windows 10 Home with Docker tools.

When I execute docker-compose, I got the following error.

remid@LAPTOP-MINGW64 /c/users/remid/dockerized (master)
$  docker-compose up
Starting dockerized_nextjs_1 ... done                                               Attaching to dockerized_nextjs_1
nextjs_1  | npm ERR! code ENOENT
nextjs_1  | npm ERR! syscall open
nextjs_1  | npm ERR! path /usr/src/app/package.json
nextjs_1  | npm ERR! errno -2
nextjs_1  | npm ERR! enoent ENOENT: no such file or directory, open '/usr/src/app/package.json'
nextjs_1  | npm ERR! enoent This is related to npm not being able to find a file.
nextjs_1  | npm ERR! enoent
nextjs_1  |
nextjs_1  | npm ERR! A complete log of this run can be found in:
nextjs_1  | npm ERR!     /root/.npm/_logs/2020-03-29T23_25_25_944Z-debug.log
dockerized_nextjs_1 exited with code 254

I have also tried to build the image with docker build with no error:

docker build . project

Step 10/10 : CMD "npm" "run" "dev"
 ---> Running in 9adcae1ef952
Removing intermediate container 9adcae1ef952
 ---> ec652f219f51
Successfully built ec652f219f51
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.```

It runs well, I can curl -I http://localhost:3000 with success from the container.

remid@MINGW64 /c/users/remid/dockerized/packages/landingpage (master)
$ docker run  ec652f219f51

> [email protected] dev /usr/src/app
> next

[ wait ]  starting the development server ...
[ info ]  waiting on http://localhost:3000 ...
> Using "webpackDevMiddleware" config function defined in next.config.js.

However, when trying to map the ports, I got the following error:

$ docker run  ec652f219f51 -p 3001:3000
[eval]:1
3001:3000
    ^

SyntaxError: Unexpected token ':'
    at new Script (vm.js:88:7)
    at createScript (vm.js:263:10)
    at Object.runInThisContext (vm.js:311:10)
    at Object.<anonymous> ([eval]-wrapper:10:26)
    at Module._compile (internal/modules/cjs/loader.js:1158:30)
    at evalScript (internal/process/execution.js:94:25)
    at internal/main/eval_string.js:23:3

Thanks for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.