【问题标题】:Installed node js getting "The syntax of the command is incoorect"安装的节点 js 得到“命令的语法不正确”
【发布时间】:2022-01-10 09:02:14
【问题描述】:

我昨天在我的电脑上更新了 node.js,它似乎安装得很好。如果我输入 -v 我会得到正确的信息。

node -v

我得到了正确的 v16.13.1 版本号

但是当我尝试输入时

npm -v

我得到了三行

The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
The syntax of the command is incorrect. 
/F was unexpected at this time. 

系统信息

Windows 10 Home 64 位,操作系统版本 19043.1348

【问题讨论】:

    标签: node.js npm npm-install


    【解决方案1】:

    您需要将C:\Program Files\nodejs 添加到您的 PATH 环境变量中。

    1- 在开始菜单中搜索“编辑系统环境变量”

    2- 点击“环境变量”

    3- 在“系统变量”中找到路径并点击编辑

    4- 添加nodejs路径

    5- 添加 npm 路径 %USERPROFILE%\AppData\Roaming\npm

    6-关闭所有命令提示符并再次打开。

    【讨论】:

      猜你喜欢
      • 2015-12-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-02
      相关资源
      最近更新 更多