When running npm or npx this error happens:
Error: bad marker
at ConfigChain.add (/Users/j42/.fnm/node-versions/v12.14.1/installation/lib/node_modules/npm/node_modules/config-chain/index.js:252:33)
at Conf.add (/Users/j42/.fnm/node-versions/v12.14.1/installation/lib/node_modules/npm/lib/config/core.js:264:27)
at ConfigChain.addString (/Users/j42/.fnm/node-versions/v12.14.1/installation/lib/node_modules/npm/node_modules/config-chain/index.js:244:8)
at Conf.<anonymous> (/Users/j42/.fnm/node-versions/v12.14.1/installation/lib/node_modules/npm/lib/config/core.js:242:10)
at /Users/j42/.fnm/node-versions/v12.14.1/installation/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)
/Users/j42/.fnm/node-versions/v12.14.1/installation/lib/node_modules/npm/lib/npm.js:18
throw new Error('npm.load() required')
^
Error: npm.load() required
at Object.get (/Users/j42/.fnm/node-versions/v12.14.1/installation/lib/node_modules/npm/lib/npm.js:18:11)
at process.errorHandler (/Users/j42/.fnm/node-versions/v12.14.1/installation/lib/node_modules/npm/lib/utils/error-handler.js:177:32)
at process.emit (events.js:223:5)
at process._fatalException (internal/process/execution.js:150:25)
npm should be usable
Yeah, we encountered this in the CITGM tests just recently, I was wondering if anyone would run into that race condition outside of CITGM.
Currently in the middle of clearing out all the old code in lib/config/
, should be fixed (or at least, broken more interestingly!) in the next beta.
In the meantime, the best approach is probably to have nvm reinstall node 12.14.1 so you get a fresh v6 version.
Ok I guess I that was bad luck for me 😄
I managed to reinstall npm from another open shell in the end so all good.
I'm facing the same issue on Windows. Uninstalling and re-installing NodeJS doesn't revert the npm to v6. What would be the way to revert npm on Windows?
@AakashM maybe deleting the folders manually and then reinstalling could help.
@isaacs This is still happening on v7.0.0-beta5, breaking exactly like in beta4.
Error: bad marker
at ConfigChain.add (C:\Users\tatuu\AppData\Roaming\npm\node_modules\npm\node_modules\config-chain\index.js:252:33)
at Conf.add (C:\Users\tatuu\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:264:27)
at ConfigChain.addString (C:\Users\tatuu\AppData\Roaming\npm\node_modules\npm\node_modules\config-chain\index.js:244:8)
at Conf.<anonymous> (C:\Users\tatuu\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:242:10)
at C:\Users\tatuu\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)
C:\Users\tatuu\AppData\Roaming\npm\node_modules\npm\lib\npm.js:18
throw new Error('npm.load() required')
^
Error: npm.load() required
at Object.get (C:\Users\tatuu\AppData\Roaming\npm\node_modules\npm\lib\npm.js:18:11)
at process.errorHandler (C:\Users\tatuu\AppData\Roaming\npm\node_modules\npm\lib\utils\error-handler.js:177:32)
at process.emit (events.js:315:20)
at process._fatalException `(internal/process/execution.js:165:25)
Yes, I know. It's fixed by #1688, just landed today, which will be in beta.6.
You can npm i -g npm@github:npm/cli#release/v7.0.0-beta
right now if you want to check it out.