在 Windows 10 上安装 Node.js(和 npm) [英] Installing Node.js (and npm) on Windows 10

查看:30
本文介绍了在 Windows 10 上安装 Node.js(和 npm)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试在 Windows 10 上安装 Node 时遇到了一些问题并找到了解决方案.

I had some issues trying to install Node on Windows 10 and found the solution.

错误如下:

C:UsersStephan>npm
错误:ENOENT,stat 'C:UsersStephanAppDataRoaming pm'

C:UsersStephan>npm
Error: ENOENT, stat 'C:UsersStephanAppDataRoaming pm'

解决方案如下.

推荐答案

新安装者似乎不再有这个问题,请参阅 这个答案.com/users/158207/parag-meshram">Parag Meshram 因为我的回答现在可能已经过时了.

It seems like new installers do not have this problem anymore, see this answer by Parag Meshram as my answer is likely obsolete now.

原答案:

严格按照以下步骤操作:

Follow these steps, closely:

  • http://nodejs.org/download/ 下载 64 位版本,32 位适合潮人
  • 将它安装在任何你想要的地方,默认情况下:C:Program Files odejs
  • 控制面板 -> 系统 -> 高级系统设置 -> 环境变量
  • 选择PATH并选择编辑它.
  • http://nodejs.org/download/ download the 64 bits version, 32 is for hipsters
  • Install it anywhere you want, by default: C:Program Files odejs
  • Control Panel -> System -> Advanced system settings -> Environment Variables
  • Select PATH and choose to edit it.

如果 PATH 变量为 empty,请将其更改为:C:Users{YOUR USERNAME HERE}AppDataRoaming pm;C:Program Files odejs

If the PATH variable is empty, change it to this: C:Users{YOUR USERNAME HERE}AppDataRoaming pm;C:Program Files odejs

如果 PATH 变量已经包含 C:Users{YOUR USERNAME HERE}AppDataRoaming pm,请在后面添加以下内容:;C:Program Files odejs

If the PATH variable already contains C:Users{YOUR USERNAME HERE}AppDataRoaming pm, append the following right after: ;C:Program Files odejs

如果 PATH 变量包含信息,但没有关于 npm 的信息,请将其附加到 PATH 的末尾:;C:Users{YOUR USERNAME HERE}AppDataRoaming pm;C:Program Files odejs

If the PATH variable contains information, but nothing regarding npm, append this to the end of the PATH: ;C:Users{YOUR USERNAME HERE}AppDataRoaming pm;C:Program Files odejs

现在 PATH 变量设置正确,您仍然会遇到错误.手动进入AppData目录,会发现Roaming里面没有npm目录.手动创建此目录.

Now that the PATH variable is set correctly, you will still encounter errors. Manually go into the AppData directory and you will find that there is no npm directory inside Roaming. Manually create this directory.

重新启动命令提示符,npm 现在就可以工作了.

Re-start the command prompt and npm will now work.

这篇关于在 Windows 10 上安装 Node.js(和 npm)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆