docker-node icon indicating copy to clipboard operation
docker-node copied to clipboard

12.18.3 breaks with Docker-in-Docker

Open CptDaniel opened this issue 5 years ago • 5 comments

We are building our software on Gitlab in a Runner with docker:19.03-dind running as our docker daemon. All of our builds use node:12-alpine as base image and since yesterday we get this error in one of our projects during npm install:

SyntaxError: Error parsing /home/node/.npm/_cacache/tmp/git-clone-cceb0072/node_modules/fs-extra/package.json: Unexpected token , in JSON at position 2553

Is this fixable without pinning the version to 12.18.2 or is this an issue with fs-extra in particular?

Thanks.

CptDaniel avatar Jul 29 '20 17:07 CptDaniel

I'm experiencing this same error for different packages. For me it happens when running tests. I think a dependency of a dependency of nyc is the culprit, and fs-extra is no where to be seen in the call-stack. That to say this may be more general then just docker-in-docker. Here's the full(ish) error

SyntaxError: Error parsing /builds/root/PROJECT_PATH/node_modules/isobject/package.json: Unexpected token , in JSON at position 1496
    at JSON.parse (<anonymous>)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/builds/root/PROJECT_PATH/node_modules/is-plain-object/index.js:10:16)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Module.replacementCompile (/builds/root/PROJECT_PATH/node_modules/nyc/node_modules/append-transform/index.js:58:13) {
  path: '/builds/root/PROJECT_PATHi/node_modules/isobject/package.json'

pinning to version 12.18.2 fixes it for me as well

AlecTroemel avatar Jul 30 '20 13:07 AlecTroemel

Same also was happening on all our GitHub action nodes until we locked them at 12.18.2 as well.

cabbiepete avatar Aug 03 '20 04:08 cabbiepete

Same, also happening on my Jenkins build, in version 12.18.4

The error :

$ nyc ava --verbose --serial test/
/home/app/dist/node_modules/is-plain-object/index.js:1
SyntaxError: Error parsing /home/app/dist/node_modules/isobject/package.json: Unexpected token , in JSON at position 1496
    at JSON.parse (<anonymous>)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/app/dist/node_modules/is-plain-object/index.js:10:16)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Module.replacementCompile (/home/app/dist/node_modules/nyc/node_modules/append-transform/index.js:58:13) {
  path: '/home/app/dist/node_modules/isobject/package.json'
}

BenjD90 avatar Sep 22 '20 12:09 BenjD90

@AlecTroemel I just ran across this issue in our Gitlab pipeline. 12.18.2 is still the fix, and boy, that's... disappointing.

EyePulp avatar Dec 05 '20 00:12 EyePulp

Able to reproduce.

lucidaeon avatar May 28 '21 16:05 lucidaeon