Cli: SFDX throwing many `(node:22792) Warning: Accessing non-existent property '<prop>' of module exports inside circular dependency`

Created on 23 Feb 2021  路  8Comments  路  Source: forcedotcom/cli

Summary

All SFDX commands are now throwing strange node errors on every invocation. I have uninstalled all custom plugins and still seeing the same behavior. Seems to have been in the most recent update. Looking at the internet suggests this is a new warning thrown by Node 14.

Steps To Reproduce:

Ensure you are on the latest SFDX, run sfdx --version

(node:31052) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:31052) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:31052) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
sfdx-cli/7.88.4-3b2e55c3f1 win32-x64 node-v14.15.4

If I enabled the trace-warnings then each of those lines is expanded to the:

(node:45392) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:650:11)
    at Object.get (internal/modules/cjs/loader.js:664:5)
    at Object._register [as register] (C:\Users\<user>\AppData\Local\sfdx\node_modules\shelljs\src\common.js:453:12)
    at Object.<anonymous> (C:\Users\<user>\AppData\Local\sfdx\node_modules\shelljs\src\which.js:5:8)
    at Module._compile (C:\Users\<user>\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (C:\Users\<user>\AppData\Local\sfdx\client\7.88.4-3b2e55c3f1\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)

I realize this is an upstream dependency but thought it should still be logged here.

Expected result

Only display the version

Actual result

Lots of warning messages displayed and clogging up my output.

Additional information

_Feel free to attach a screenshot_.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.88.4-3b2e55c3f1 win32-x64 node-v14.15.4

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

@oclif/plugin-autocomplete 0.3.0 (core)
@oclif/plugin-commands 1.3.0 (core)
@oclif/plugin-not-found 1.2.4 (core)
@oclif/plugin-plugins 1.9.5 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/lwc-dev-server 2.10.0
鈹溾攢 @oclif/plugin-help 2.2.2
鈹斺攢 @oclif/plugin-update 1.3.9
@salesforce/sfdx-trust 3.6.0 (core)
alias 1.1.5 (core)
auth 1.4.8 (core)
config 1.2.4 (core)
generator 1.1.5 (core)
salesforcedx 51.0.4 (core)
鈹溾攢 limits 1.0.4 (core)
鈹溾攢 schema 1.0.4 (core)
鈹溾攢 user 1.1.2 (core)
鈹溾攢 custom-metadata 1.0.11 (core)
鈹溾攢 apex 0.1.4 (core)
鈹溾攢 templates 51.2.0 (core)
鈹溾攢 @salesforce/sfdx-plugin-lwc-test 0.1.7 (core)
鈹斺攢 salesforce-alm 51.0.2 (core)
sfdx-cli 7.88.4 (core)
telemetry 1.1.1 (core)

OS and version:
Windows 10

investigating

Most helpful comment

Just a note on Node versions.

I'm on Node.js v12.17.0 and was seeing the same Node warnings from sfdx commands.
The dev server uninstall cmd : sfdx plugins:uninstall @salesforce/lwc-dev-server
has resolved the warning message deluge however.

All 8 comments

Git2Gus App is installed but the .git2gus/config.json doesn't have right values. You should add the required configuration.

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

Thanks @zerkz. I can confirm that this goes away if I uninstall the lwc-dev-server plugin.

Just a note on Node versions.

I'm on Node.js v12.17.0 and was seeing the same Node warnings from sfdx commands.
The dev server uninstall cmd : sfdx plugins:uninstall @salesforce/lwc-dev-server
has resolved the warning message deluge however.

I have the same issue. I did not know that I had lwc-dev-server as it is not in my extensions list but I ran the command anyway (I have no idea what I'm doing with Node) and it removed the issue. I have no idea if I need this plugin or what it is going to do by not having it.

In my case I solved it with updating shelljs package

from: "shelljs": "^0.7.6",
to: "shelljs": "^0.8.4",

Look closely to your logging:
_at Object._register [as register] (C:\Users\\AppData\Local\sfdxnode_modulesshelljs\src\common.js:453:12)_

Seems like the sfdx-mobilesdk-plugin is also causing similar errors, once I uninstall it they went away

Was this page helpful?
0 / 5 - 0 ratings