我正在visual-studio-code上运行windows-10。我已将command-line-interface配置为cmd。exe。
当我打开命令提示符并查看path时,可以看到它已从const List<String> sortingOrder = ['January', 'February', 'March', 'April',
'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
List<String> months = ['October', 'January', 'July'];
months.sort((a, b) => sortingOrder.indexOf(a).compareTo(sortingOrder.indexOf(b)));
print(months); // [January, July, October]
更改为C:\Program Files\nodejs
。
当我直接运行C:\Program Files (x86)\nodejs
,(不在vscode内)时,cmd.exe
是正确的。
我知道Windows在PATH
目录下玩游戏,但是我不明白这里发生了什么。
这是我在Program Files
之外运行cmd
时看到的内容:
vscode
这是我在vscode中运行时看到的:
Microsoft Windows [Version 10.0.16299.1029]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\jeff>path
PATH=C:\Python37\Scripts\;C:\Python37\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\libnvvp;C:\oracle\product\11.2.0\client_1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\app\jefforacle\product\12.1.0\client_1\bin;c:\jdk8u72\jdk1.8.0_72\bin;C:\ProgramData\Oracle\Java\javapath;C:\apache-maven-2.0.9\bin;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE;C:\Program Files (x86)\WinZip;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;L:\prj\defaults\code\bin;f:\apps\exec;L:\Prj\JavaDflts\code\BIN;C:\Program Files (x86)\AccuRev\bin;C:\Program Files (x86)\WinMerge;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\doxygen\bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\AMD\ATI.ACE\Core-Static;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Users\jeff\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files\MariaDB 10.1\lib;C:\Program Files\PuTTY\;C:\Program Files\Git\cmd;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Gradle\gradle-5.4.1\bin;C:\Users\jeff\AppData\Local\Android\Sdk\tools;C:\Users\jeff\AppData\Local\Android\Sdk\tools\bin;C:\Users\jeff\AppData\Local\Android\Sdk\platform-tools;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\nodejs\;C:\Users\jeff\AppData\Local\Microsoft\WindowsApps;C:\Users\jeff\AppData\Local\GitHubDesktop\bin;C:\Users\jeff\AppData\Roaming\npm;
C:\Users\jeff>where node
C:\Program Files\nodejs\node.exe
答案 0 :(得分:0)
找到了。实际上,在系统设置中更改path env变量后,实际上必须重新启动vscode才能在终端窗口中运行的cmd.exe中获得新路径。
停止并重新启动终端是不够的。