calling rmdir node_modules /S /Q from powershell



是否可以调用:

rmdir node_modules /S /Q

来自powershell。powershell中的某些文件夹出现了可怕的路径过长错误。使用rmdir可以绕过这个问题。

rmdir是CMD内置命令。您可以通过调用cmd.exe:从PowerShell使用它

& cmd /c rmdir node_modules /s /q

我没有powershell可以在这台机器上测试,但这个命令应该是等效的:

Remove-Item -Force -Recurse node_modules

请注意,-Recurse选项有时无法正常工作。

所以如果前一个失败(很可能?),您可以改为:

Get-ChildItem -Path node_modules -Recurse | Remove-Item -Force

最新更新