Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error: bad marker at ConfigChain.add using fnm with node v12.14.1 #1660

Closed
Jolg42 opened this issue Aug 12, 2020 · 6 comments
Closed
Assignees
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@Jolg42
Copy link

Jolg42 commented Aug 12, 2020

Current Behavior:

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)

Expected Behavior:

npm should be usable

Steps To Reproduce:

  • npm i -g npm@next-7
  • npm & npx are now completely broken 🤷‍♂️

Environment:

  • OS: macOS 10.15.6 (Catalina)
  • Node: 12.14.1
  • NPM: 7.0.0-beta.4
  • fnm: 1.18.1
@isaacs
Copy link
Contributor

isaacs commented Aug 12, 2020

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.

@isaacs isaacs self-assigned this Aug 12, 2020
@Jolg42
Copy link
Author

Jolg42 commented Aug 13, 2020

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.

@darcyclarke darcyclarke added Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release labels Aug 14, 2020
@AakashM
Copy link

AakashM commented Aug 15, 2020

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?

@Jolg42
Copy link
Author

Jolg42 commented Aug 15, 2020

@AakashM maybe deleting the folders manually and then reinstalling could help.

https://stackoverflow.com/a/20711410/1345244

@TatuUlmanen
Copy link

@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)

Environment:

  • OS: Windows 10
  • Node: v13.12.0
  • NPM: v7.0.0-beta.5

@isaacs
Copy link
Contributor

isaacs commented Aug 20, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

5 participants