Netlify CLI Broke After Update

After Updating Netlify CLI, I’m getting this error when trying to run any netlify-cli commands. Can somone help me understand what this is and how to fix this.

TypeError: Cannot read property 'replace' of null
    at resolvePath (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/files.js:36:22)
    at searchBaseConfigFile (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/path.js:44:20)
    at getConfigPath (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/path.js:20:7)
    at getFullConfig (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/main.js:140:28)
    at loadConfig (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/main.js:112:13)
    at resolveConfig (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/main.js:59:40)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async OpenCommand.getConfig (/usr/lib/node_modules/netlify-cli/src/utils/command.js:76:14)
    at async OpenCommand.init (/usr/lib/node_modules/netlify-cli/src/utils/command.js:37:26)
    at async OpenCommand._run (/usr/lib/node_modules/netlify-cli/node_modules/@oclif/command/lib/command.js:43:13)

Full Error

  @oclif/config reading core plugin /usr/lib/node_modules/netlify-cli +0ms
  @oclif/config loadJSON /usr/lib/node_modules/netlify-cli/package.json +0ms
  @oclif/config loadJSON /usr/lib/node_modules/netlify-cli/oclif.manifest.json +3ms
  @oclif/config:netlify-cli using manifest from /usr/lib/node_modules/netlify-cli/oclif.manifest.json +0ms
  @oclif/config reading user plugins pjson /home/alwin/.local/share/netlify-cli/package.json +0ms
  @oclif/config loadJSON /home/alwin/.local/share/netlify-cli/package.json +2ms
  @oclif/config loading plugins [
  '@oclif/plugin-not-found',
  '@oclif/plugin-plugins',
  '@oclif/plugin-help'
] +0ms
  @oclif/config reading core plugin /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-not-found +0ms
  @oclif/config loadJSON /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-not-found/package.json +3ms
  @oclif/config reading core plugin /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-plugins +0ms
  @oclif/config loadJSON /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-plugins/package.json +0ms
  @oclif/config reading core plugin /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-help +0ms
  @oclif/config loadJSON /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-help/package.json +0ms
  @oclif/config loadJSON /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-not-found/oclif.manifest.json +1ms
  @oclif/config loadJSON /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-plugins/oclif.manifest.json +1ms
  @oclif/config loadJSON /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-help/oclif.manifest.json +1ms
  @oclif/config:@oclif/plugin-not-found using manifest from /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-not-found/oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-plugins using manifest from /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-plugins/oclif.manifest.json +0ms
  @oclif/config:@oclif/plugin-help using manifest from /usr/lib/node_modules/netlify-cli/node_modules/@oclif/plugin-help/oclif.manifest.json +0ms
  @oclif/config config done +7ms
  @oclif/config start init hook +0ms
  netlify:netlify-cli:hooks:init start /usr/lib/node_modules/netlify-cli/src/hooks/init +0ms
  netlify:netlify-cli:hooks:init done +51ms
  @oclif/config init hook done +253ms
  netlify init version: @oclif/command@1.5.19 argv: [ 'dev' ] +0ms
  @oclif/config runCommand dev [] +3ms
  @oclif/config:netlify-cli require /usr/lib/node_modules/netlify-cli/src/commands/dev/index.js +265ms
winston:create-logger Define prototype method for "error"
winston:create-logger Define prototype method for "warn"
winston:create-logger Define prototype method for "info"
winston:create-logger Define prototype method for "http"
winston:create-logger Define prototype method for "verbose"
winston:create-logger Define prototype method for "debug"
winston:create-logger Define prototype method for "silly"
winston:create-logger Define prototype method for "error"
winston:create-logger Define prototype method for "warn"
winston:create-logger Define prototype method for "info"
winston:create-logger Define prototype method for "http"
winston:create-logger Define prototype method for "verbose"
winston:create-logger Define prototype method for "debug"
winston:create-logger Define prototype method for "silly"
  @oclif/config start prerun hook +781ms
  @oclif/config prerun hook done +1ms
TypeError: Cannot read property 'replace' of null
    at resolvePath (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/files.js:36:22)
    at searchBaseConfigFile (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/path.js:44:20)
    at getConfigPath (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/path.js:20:7)
    at getFullConfig (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/main.js:140:28)
    at loadConfig (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/main.js:112:13)
    at resolveConfig (/usr/lib/node_modules/netlify-cli/node_modules/@netlify/config/src/main.js:59:40)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async DevCommand.getConfig (/usr/lib/node_modules/netlify-cli/src/utils/command.js:76:14)
    at async DevCommand.init (/usr/lib/node_modules/netlify-cli/src/utils/command.js:37:26)
    at async DevCommand._run (/usr/lib/node_modules/netlify-cli/node_modules/@oclif/command/lib/command.js:43:13)
1 Like

hi there, which version of the CLI are you using? we have just published 2.43.0, which may fix your issue:

If you are still having problems, it would be fantastic if you could file an issue directly on the CLI repo. Many thanks!