SFDX Falcon plugin fix for Windows

Rate this post

SFDX Falcon plugin is an amazing tool and a marvel of SFDX. Using this tool you can create AppExchange Demo Kit (ADK) project in 10 minutes or less! 

ADK projects allow Salesforce Developers to build and share rich, dynamic demo orgs in a source-centric manner without requiring batch files or shell scripts.

AppExchange Demo Kit (ADK) falcon:adk:install

More about SFDX Falcon.

Windows OS Issue

People working with this Plugin on Windows (whatever version) faces an issue,

The step "Create New Scratch Org" has failed. Its action, "create-scratch-org", returned the following error:
SfdxCliError: Failed to create scratch org using demo-scratch-def.json. ENOENT: no such file or directory, open 'C:\sfdx\falcon\falcon-quick-start\test-drive'C:\sfdx\falcon\falcon-quick-start\test-drive\config\demo-scratch-def.json''

The reason is the way this plugin handles filepath is not being fully cross-platform. This works fine on MacOS though.

Workaround

Thanks to Thomas Taylor for providing us with this workaround and shared it with the other people on the Github Issue

The workaround for the windows user is commenting out the following line in the NPM module having path,

C:\Users\[USERNAME]\AppData\Local\sfdx\node_modules\sfdx-falcon\lib\modules\sfdx-falcon-recipe\executors\sfdx.js :

argument = "'" + argument.replace(/'/g, "'\\''") + "'"; // Escape any existing single quotes.

Conclusion

Thanks to Vikram Chawala and other Salesforce Evangelists who did build this AMAZING plugin and hopefully, we’ll have this and other issues resolved by any of the future releases.

Happy Coding!

Leave a Comment