在windows上安装Node后,Node命令在cmd中不起作用

Node command is not working in cmd after installing node on windows?

本文关键字:Node cmd 不起作用 命令 windows 安装      更新时间:2023-09-26

我已经从node的官方站点安装了node v4。现在,当我尝试在cmd中运行node命令时,它显示以下内容:-

C:'Users'PcName>node
Node Commands
Syntax:
    node {operator} [options] [arguments]
Parameters:
        /? or /help   - Display this help message.
        list          - List nodes or node history or the cluster
        listcores     - List cores on the cluster
        view          - View properties of a node
        online        - Set nodes or node to online state
        offline       - Set one or more nodes to the offline state
For more information about HPC command-line tools,
see http://go.microsoft.com/fwlink/?LinkId=120724.

无法理解这里出了什么问题。

作为参考,这里是我的路径变量的值:-

PATH=c:'Program Files'Microsoft HPC Pack 2012'Bin';c:'PROGRA~1'ds_shell'code'bin'ds_shell;C:'Oracle11gR2_64bCli'client_1'bin;C:'Oracle11gR2_32bCli'client_1'bin;C:'Program Files'Microsoft MPI'Bin';C:'windows'system32;C:'windows;C:'windows'System32'Wbem;C:'windows'System32'WindowsPowerShell'v1.0';c:'Program Files (x86)'Microsoft SQL Server'90'Tools'binn';C:'Program Files'Microsoft'Web Platform Installer';C:'Program Files (x86)'Microsoft ASP.NET'ASP.NET Web Pages'v1.0';C:'Program Files (x86)'Windows Kits'8.0'Windows Performance Toolkit';C:'Program Files'Microsoft SQL Server'110'Tools'Binn';C:'Program Files'nodejs';C:'Program Files'Git'cmd;C:'Users'ama16'AppData'Roaming'npm;C:'Program Files'nodejs;C:'Program Files'nodejs'node_modules'npm'bin

显然在

中有一个名为NODE的命令
c:'Program Files'Microsoft HPC Pack 2012'Bin'

重命名该命令,或者使用nodejs命令提示符(点击开始,输入nodejs,你应该会看到选项出现),或者将node安装文件夹中的node .exe重命名为nodejs.exe,然后在命令行

使用nodejs

设置系统的PATH变量。如果没有添加,请确保添加了节点路径。

检查您的PATH,您可以通过右键单击MYComputer->属性->高级系统设置->环境变量->

查看它

在"用户变量"或"系统变量"中找到变量PATH并添加node.js文件夹路径作为值。

重启IDE AND CMD

****在cmd中使用nodejs命令之前,请确保在系统变量***

中添加了节点路径

命令"node"只有在node自己的命令shell中运行时才会调用交互式shell。如果你没有在shell上运行"node",你必须指定与它一起运行的javascript文件