-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
cross-env not found #175
Comments
I'm running Docker for Mac, Version 1.12.0-rc2-beta16 (build: 9493), in case that's related to the issue. |
NPM install might have failed while building. Could you SSH into the container and try deleting |
I have same problem. |
My fix for this problem: https://github.com/karudo/mern-starter/commit/095d3a5e07154d9daa3cdfc9d1f1075fe4b914c9 |
@kandros any idea why this is happening? |
I have the same problem, I think it has something to do with the mounting of the volume to host source in the docker compose file. When this happens, for some reason I think the node_modules folder is being deleted in the container since the local host folder does not contain them. The build happened on the container not your local host so the folder node_modules does not exist. when you remove the "volumes: - .:/usr/src/app/" command from the docker-compose file, it works but you don't have a mounted volume to work with. I'm still reading up on docker and why this is the case. |
I found this post considering the problem we have here.
So what I did was updating the volumes section in the web:
build: .
...
volumes:
- .:/usr/src/app/
- /usr/src/app/node_modules After this I've built the container again and everything worked like a charm 🎉. Initially I thought it was the version of docker-compose, because I had a Ubuntu 16.04 running with version |
@wdhorton Have you got a chance to try @iphilgood fix? |
Hi there. The fix from @iphilgood works like a charm. The thing that annoy me is when mounting the whole directory
is that there are files produced by Webpack sent back to host machine. So I take an alternative approach.
Related PR #246 |
I'd just like to add that if @iphilgood 's solution above doesn't work for you, it might be worth starting from scratch – remove the container, remove the built image, and then remove dangling volumes. I think I had a dangling volume that still have the cached |
Just merge @wootsaejao PR #246 |
I followed the instructions to run docker for development. I ran
docker-compose -f docker-compose-development.yml build
and it succeeded, but thendocker-compose -f docker-compose-development.yml up
failed because one of the npm scripts was looking forcross-env
and couldn't find it. Here's the trace:The text was updated successfully, but these errors were encountered: