Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 从powershell调用rmdir节点_模块/S/Q_Windows_Powershell - Fatal编程技术网

Windows 从powershell调用rmdir节点_模块/S/Q

Windows 从powershell调用rmdir节点_模块/S/Q,windows,powershell,Windows,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_module

是否可以拨打:

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

我通常通过重命名太长的文件夹来解决这个问题。从PS的角度来看,这也应该是可行的。这将导致路径过长异常而失败。