I've installed the sfdx CLI utility but I cannot actually run any commands, as anything I try I get the following error:

! this.log is not a function

This seems to be some sort of Javascript issue with my workstation but I can't seem to figure out what could be causing it.

I'm on the following versions:

  • node 8.9.4 (downgraded from 8.11 in case that was the issue - it wasn't)
  • npm 5.6.0
  • sfdx-cli/6.38.0 (windows-x64) node-v8.9.4
  • Windows 10 enterprise v.1803

Has anyone else run into this?

  • 1
    Do you get any output from sfdx plugins --core? If so, what are the results? – sfdcfox Nov 8 '18 at 15:37
  • Yep - @salesforce/plugin-generator 0.0.10 (core) @salesforce/sfdx-trust 1.0.8 (core) builtins 1.0.0 (core) salesforcedx 44.5.0 (core) – Scott Geosits Nov 8 '18 at 16:54
  • Okay, your DX is definitely up to date, then. You mentioned deprecated plugins, though: what's sfdx plugins show? – sfdcfox Nov 8 '18 at 17:08
  • ! no plugins installed – Scott Geosits Nov 8 '18 at 18:45
  • I ran sfdx plugins:install salesforcedx@latest and now I'm showing salesforcedx 44.5.0 when I run sfdx plugins but still getting the error. Are there other plugins I need to install? – Scott Geosits Nov 8 '18 at 21:18

I asked this question in another post and it was answered by @kevin-p here: SFDX: this.log is not a function when running create commands

His answer was:

If you find a file .yo-rc.json in your project root, or any folder above it rename or delete that .yo-rc.json file, and you'll be good to go. In my case, the file was in my ~ folder. Even though my code was in ~/Code/helloWorldLWC the presence of that file in my home directory caused the self.log is not a function error.

  • Amazing - that fixed it. I didn't even remember running Yeoman at first but now I do. I would have never thought to look into that. Thanks! – Scott Geosits Dec 14 '18 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.