-
Notifications
You must be signed in to change notification settings - Fork 2.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
macOS Docker build error: Error: Cannot find module '../' #2333
Comments
any update on the situation, cause i have been working to get this resolved for over five days |
Unfortunately, no news yet. You should be able to build on any other operating system, so there are workarounds until this is resolved. Building on CircleCI or a remote machine managed with Docker Machine are my two current recommendations. Reaction already has a working CircleCI config that you can customize. If you don't need build automation from CircleCI, you could just use Docker Machine to start a build server whenever you need it. It only takes about 2 minutes for a new server to be ready. You can start the server, do a build on it, push it to Docker Hub, and then shut down the server. You can use a really powerful server with tons of resources and it'll barely cost anything. Start a server # Digital Ocean
# https://docs.docker.com/machine/drivers/digital-ocean/
docker-machine create \
--driver digitalocean \
--digitalocean-access-token <your API key> \
--digitalocean-size 8gb \
builder
# or...
# AWS
# https://docs.docker.com/machine/drivers/aws/
docker-machine create \
--driver amazonec2 \
--amazonec2-access-key <access key> \
--amazonec2-secret-key <secret key> \
--amazonec2-region us-east-1 \
--amazonec2-instance-type t2.large \
builder Tell your local Docker to run on the remote server eval "$(docker-machine env builder)" Build/push your custom image # build
docker build -t myorg/reaction:latest .
# push to Docker Hub
docker push myorg/reaction:latest Shut the server down until you need it again docker-machine stop builder Start the server when you need to build again docker-machine start builder
eval "$(docker-machine env builder)"
# do your builds... Destroy the server when you no longer need it docker-machine kill builder
docker-machine rm builder Aside from the fact that this is a workaround to issues with Meteor builds on macOS, this also lets you do much faster builds on high power servers that have tons of resources and network bandwidth. And it will cost a few pennies at most. |
By removing the I am hoping the ..modules error may have been caused by the various build issues reported on the bcrypt repo, and that the build was attempting to use the failed install(?).
...
Like to see if anyone else is able to reproduce this build(success)? |
I can confirm this fixes the build issues on macOS. And the container definitely runs/works. I love fixes like that. This doesn't explain why every other Meteor app isn't having the same problem, but I'll take the win! |
Inspired by @tdmoneybanks suggestion that we remove bcrypt, once I started looking at those build errors I got suspicious as this was very similar to a closed Meteor issue for |
Resolves #2333 Apparently the failing bcrypt / fallback installation was causing ..module not found errors. — need to evaluate for performance issues (see warning) — need to update docs to warn about the warning.. — todo find better solution!
JACKPOT. Just proved it's 100% on Meteor and has nothing to do with Reaction. Reproduction steps... # create a fresh/empty Meteor app
meteor create docker-fail
cd docker-fail
# install bcrypt
meteor npm i -S bcrypt
# add a Dockerfile
echo "FROM jshimko/meteor-launchpad:latest" > Dockerfile
# build
docker build -t my-test .
# FAIL
...
Error: Cannot find module '../'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/opt/meteor/dist/bundle/programs/server/npm/node_modules/.bin/node-pre-gyp:15:20)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10) Now confirm it was bcrypt for good measure... meteor npm uninstall -S bcrypt
docker build -t my-test .
# SUCCESS!
...
Successfully built 1bded9798423
Successfully tagged my-test:latest I'll file an issue with them in the morning. |
Resolves #2333 Apparently the failing bcrypt / fallback installation was causing ..module not found errors. — need to evaluate for performance issues (see warning) — need to update docs to warn about the warning.. — todo find better solution!
So is the solution to use the bcryptjs workaround? I would like to get started with the docker image build process, I lost few days when I attempted a couple weeks ago, the docker mac build solution in the docs.
S. Tunji Turner
sightuary
… On Jul 19, 2017, at 7:42 PM, Aaron Judd ***@***.***> wrote:
Closed #2333.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi @jshimko I would be very interested in following the issue tracker for bcrypt in Meteor. Would you be able to provide us with the link? |
@stunjiturner yes, seems to be the fix. Something else that we could try is going back a few versions of bcrypt until we find one that does work with the Meteor build. (at some point, there had to be a compatible release). |
Several people (including myself) have been consistently seeing this when trying to build the default Reaction image on macOS. I believe this is a result of changes that Meteor released to fix the last macOS/Docker file system nightmare that took 6 months to clear up.
The original Meteor/Docker build issue was (meteor/meteor#8491), but after my PR was merged, they realized that it caused a new one (meteor/meteor#8569) that was related to the way Windows handles symlinks. So a bunch of changes were made to several core file system methods that are used in the
meteor build
command in that second PR. The missing module errors below started happening for me immediately after that release.All of Meteor's file system handling methods are defined here, so I'm pretty sure that's where the fix will end up being.
As with most core Meteor issues, I just have no idea where to start to troubleshoot it. Supporting all major file systems is hard. You fix one problem and then another pops up on a different OS as a result.
The text was updated successfully, but these errors were encountered: