node.js 尽管已成功安装,但仍无法识别节点

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10129505/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 15:31:50  来源:igfitidea点击:

Node not recognized although successfully installed

windowsnode.jspath

提问by Soroush Hakami

I try to run nodejson a brand new installation of Windows 7. This is what I've done:

我尝试在全新安装的Windows 7上运行nodejs。这就是我所做的:

  1. Install node using the windows installer

  2. Make sure the files were extracted to C:\Program Files (x86)\nodejs\

  3. Make sure that my Path enviorment variable contains C:\Program Files (x86)\nodejs\

  4. open up a command prompt and run node -v

  1. 使用 Windows 安装程序安装节点

  2. 确保文件被提取到 C:\Program Files (x86)\nodejs\

  3. 确保我的 Path 环境变量包含 C:\Program Files (x86)\nodejs\

  4. 打开命令提示符并运行 node -v

This gives me the 'node is not a recognized ...'- message.

这给了我'node is not a recognized ...'- 消息。

What am I missing here?

我在这里缺少什么?



Updaterunning echo %path%gives me a directory listing that doesn't include C:\Program Files (x86)\nodejs\, even though looking at the "environment variables" tab in the system properties displays it under path. Thats odd.

更新运行echo %path%为我提供了一个不包含的目录列表C:\Program Files (x86)\nodejs\,即使查看系统属性中的“环境变量”选项卡将其显示在路径下。真奇怪。

回答by Soroush Hakami

UPDATE: a quicker solution is per Timos comment: "Restarting explorer.exe is enough, you can stop it in task manager and start it again"

更新:根据 Timos 评论有一个更快的解决方案:“重新启动 explorer.exe 就足够了,您可以在任务管理器中将其停止并重新启动”

This was solved by restarting the computer.

这是通过重新启动计算机解决的。

Apparently, using the Node installer sets the path so that it is visible under system properties, but not in the command prompt (running echo %path%) until you restart your computer. Not sure if this is a problem with Windows, or the Node Installer.

显然,使用 Node 安装程序设置路径,使其在系统属性下可见,但在命令提示符(运行 echo %path%)中不可见,直到您重新启动计算机。不确定这是 Windows 还是节点安装程序的问题。

回答by sesamechicken

Timo's statement is accurate. For completeness...

蒂莫的说法是准确的。为了完整性...

To start explore.exeagain, Ctrl+Shift+Escto open Task Manager

要开始explore.exe再次Ctrl+ Shift+Esc打开Task Manager

Then do File > New Task (Run)> type: explorer.exe> Enter > Voila!

然后执行 File > New Task (Run) > type: explorer.exe> Enter > Voila!