是否可以调用:
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