Skip to content

Fix Windows compatibility issue by replacing rm with rimraf#178

Open
ShubhamS2005 wants to merge 1 commit intoRocketChat:masterfrom
ShubhamS2005:fix-windows-rm-command
Open

Fix Windows compatibility issue by replacing rm with rimraf#178
ShubhamS2005 wants to merge 1 commit intoRocketChat:masterfrom
ShubhamS2005:fix-windows-rm-command

Conversation

@ShubhamS2005
Copy link

@ShubhamS2005 ShubhamS2005 commented Mar 15, 2026

Closes #179

I tried running the CLI on Windows and encountered the error:

'rm' is not recognized as an internal or external command

This occurs because some scripts in package.json use the Unix rm command,
which is not available on Windows environments.

To make the scripts cross-platform, I replaced rm with rimraf,
which works consistently on Windows, macOS, and Linux.

Changes made:

  • Replaced rm -rf lib with rimraf lib
  • Replaced rm -f oclif.manifest.json with rimraf oclif.manifest.json

Tested locally on:

  • Windows 11
  • Node.js v20

Code Change

Before:

"clean": "rm -rf lib",
"postpack": "rm -f oclif.manifest.json"

After:

"clean": "rimraf lib",
"postpack": "rimraf oclif.manifest.json"

Before

Screenshot 2026-03-15 194131

After

Screenshot 2026-03-15 195730

After this change, npm install and the CLI setup run successfully without the Windows error.

@CLAassistant
Copy link

CLAassistant commented Mar 15, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI installation fails on Windows because package.json scripts use Unix rm command

2 participants