Skip to content

Docker compose fails #30

@jreades

Description

@jreades

Hi -- I'm trying to adapt a starter Python course that we wrote a few years ago for use with Binder to the template provided here since it provides a lot of really useful features in terms of self-testing of both code and comprehension.

We already make use of Docker so I was quite excited to think that I'd not have to go anywhere near npm since my previous excursions into the package manager have been... challenging. It might just be my poor understanding of node, but having forked the repository as a template and cloned it to my local machine I'm stuck on this:

 ⠿ Container code-camp-rebooted-gatsby-1  Create...                                        27.1s
Attaching to code-camp-rebooted-gatsby-1
code-camp-rebooted-gatsby-1  | /usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/telemetry.js:39
code-camp-rebooted-gatsby-1  |   store = new _eventStorage.EventStorage();
code-camp-rebooted-gatsby-1  |         ^
code-camp-rebooted-gatsby-1  |
code-camp-rebooted-gatsby-1  | SyntaxError: Unexpected token =
code-camp-rebooted-gatsby-1  |     at Module._compile (internal/modules/cjs/loader.js:723:23)
code-camp-rebooted-gatsby-1  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
code-camp-rebooted-gatsby-1  |     at Module.load (internal/modules/cjs/loader.js:653:32)
code-camp-rebooted-gatsby-1  |     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
code-camp-rebooted-gatsby-1  |     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
code-camp-rebooted-gatsby-1  |     at Module.require (internal/modules/cjs/loader.js:692:17)
code-camp-rebooted-gatsby-1  |     at require (internal/modules/cjs/helpers.js:25:18)
code-camp-rebooted-gatsby-1  |     at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/index.js:21:18)
code-camp-rebooted-gatsby-1  |     at Module._compile (internal/modules/cjs/loader.js:778:30)
code-camp-rebooted-gatsby-1  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
code-camp-rebooted-gatsby-1 exited with code 1

This is using the repo as cloned on Docker 4.4.2 (Intel Mac running Monterey 12.2.1) with no attempts at modification. Tracing this error via Google led me to this:

With what you provided I'd guess you're running an ancient version of Node:

.nvm/versions/node/v10.24.1
You'll need to use at least Node 14.15.0 with Gatsby

So it looks to me like something (in sharp?) is no longer compatible with what's being installed during docker-compose and hasn't had its version pinned to a compatible one (which seems strange given the sheer overwhelming detail of package-lock.json). Trying to manually install sharp as part of the build process hasn't worked for me. This is almost certainly a function of my lack of knowledge about node. Is there a pre-built image somewhere that I can use, or does that not work because the web site is not actually mounted from the local FS but baked into the build? It doesn't look like that's the case but...

Anyway, since then I've tried this tutorial, this tutorial, and this tutorial. The last one has gotten me closest to a running Docker image but installs someone else's package.json plan with various version locks that are only a bit more recent than this starter course. When I try to bring in the bits that seem to be missing (by comparing against your package.json file) I end up in npm ::hell::.

Is there a process/explanation for installing this stuff from scratch so that I'm not doing cargo cult stuff with npm, package.json, and package-lock.json?

If I can get this building I'd be happy to put a Docker image on the Hub so that a backup process exists as and when the build starts failing...

P.S. Do I also infer that each code cell currently launches its own Binder instance?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions