简体   繁体   English

在带有 Windows 的 VSC 上使用 node.js 时出现问题

[英]Problem with using node.js on VSC with Windows

My laptop is 64-bit operating system, Windows 10 I have installed Node.js for Windows (version v12.17.0) I have installed code.runner on VSC as well我的笔记本电脑是 64 位操作系统,Windows 10 我已经为 Windows 安装了 Node.js(版本 v12.17.0)我已经在 VSC 上安装了 code.runner

However, the error msg "Command 'node' not found, but can be installed with:但是,错误消息“找不到命令'node',但可以安装:

sudo apt install nodejs" sudo apt install nodejs"

keep appearing.不断出现。 I have no idea what is wrong.我不知道出了什么问题。

Will changing the user settings or workspace settings help?更改用户设置或工作区设置会有帮助吗?

The problem is that you have not set the Path in the Environment Variables.问题是您没有在环境变量中设置路径。 In Windows, search for "Environment Variables".在 Windows 中,搜索“环境变量”。

Open Environment Variables .Open Path and add the PATH: C:\Program Files\nodejs\bin打开环境变量。打开路径并添加路径: C:\Program Files\nodejs\bin

By default, the installer uses the Node.js distribution in C:\Program Files\nodejs .默认情况下,安装程序使用C:\Program Files\nodejs中的 Node.js 分发。 If node is installed in C:\Program Files\nodejs directory, then add the PATH in in window's PATH environment variable as C:\Program Files\nodejs\bin .如果 node 安装在C:\Program Files\nodejs目录中,则在窗口的 PATH 环境变量中添加 PATH 为C:\Program Files\nodejs\bin

Restart any open command prompts for the change to take effect.重新启动任何打开的命令提示符以使更改生效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM