cncjs: Latest Docker image throws: Error: Cannot find module '@babel/polyfill'
Description
Describe the issue or feature request in detail. Take a screenshot or record a video will be helpful.
Versions
- CNCjs: 1.10.2 (Docker latest)
- Node.js: 6.x
- NPM: 5.x
How Do You Install CNCjs?
- NPM
- Download the CNCjs Desktop Application
- Docker
CNC Controller
- Grbl
- Smoothieware
- TinyG/g2core
Hardware
- Raspberry Pi
- Desktop or Laptop
- Mobile Device
Operating System
- Not Applicable
- Windows
- Mac
- Linux
I am using the cncjs:latest docker container. (Also present in older images) The container throws following error on start:
`internal/modules/cjs/loader.js:905 throw err; ^
Error: Cannot find module ‘@babel/polyfill’ Require stack:
/opt/cncjs/entrypoint
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object. (/opt/cncjs/entrypoint:3:1)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/opt/cncjs/entrypoint' ]
}`
Does the Dockerimage use an old CNCJS version?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (6 by maintainers)
Also now that I see that circleci is used I peeked at the https://github.com/cncjs/cncjs/blob/master/.circleci/config.yml file and it lays out all the commands run outside of the docker container build to get it to built. Not convenient for those who don’t want to install node/yarn/devEnv on their machine to build the docker image. Now I’ve got some CNC projects to work on!
Yep, can confirm that the issue is fixed. Thank you again.
New images are updated at https://hub.docker.com/repository/docker/cncjs/cncjs/general
PR opened: https://github.com/cncjs/cncjs/pull/831
It doesn’t fully work yet, there’s a problem with the handlebars template rendering I think. Getting close though.
Aha, ok that context helps. I see now that the existing Dockerfile starts out by copying
./dist/cncjsinto the container, so the build process would have happened separately, outside thedocker buildcontext. Got it. Yournpm run build-prodstep makes sense now, the Yarn equivalent I think would beyarn run build-prod.Yes and yes 👍 it’ll use yarn.lock first and fall back on package.json for upgrades. If Yarn works like NPM does,
yarn --productionwould only use yarn.lock.At this stage, the project is built and the assets are being copied to the build directory. I bet the image will work if the next few lines are simplified to:
That’s the real question. The polyfill package should already be installed! Mysterious.
Just to give an update on the Dockerfile and building everything from scratch inside the build container. I am able to build from source a docker container by making a handful of changes to the Dockerfile. However, I think I’m doing too many steps. Comments/background appreciated on the RUN lines below:
@emcniece ?
I can confirm that the latest image for me has this error, running v1.10.2:
Docker Log:
The above repeats over and over as the container restarts.