12.18.3 breaks with Docker-in-Docker
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.
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
Same also was happening on all our GitHub action nodes until we locked them at 12.18.2 as well.
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'
}
@AlecTroemel I just ran across this issue in our Gitlab pipeline. 12.18.2 is still the fix, and boy, that's... disappointing.
Able to reproduce.