在Windows上安装节点后,节点命令在cmd中不起作用?

时间:2016-10-21 05:36:40

标签: javascript node.js cmd

我已经从节点的官方网站安装了节点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

3 个答案:

答案 0 :(得分:2)

显然,

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

重命名该命令,或使用nodejs命令提示符(单击start,键入nodejs,您应该看到该选项出现),或者将节点安装文件夹中的Node.exe重命名为nodejs.exe,然后使用nodejs命令行

答案 1 :(得分:0)

设置系统的PATH变量。确保已添加节点路径(如果未添加)。

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

来查看它。

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

重新启动IDE和CMD

****在使用cmd中的nodejs命令之前,请确保在系统变量中添加了节点路径***

答案 2 :(得分:-1)

只有从节点自己的命令shell运行它时,命令“node”才会调用交互式shell。如果您没有在该shell上运行“node”,则必须指定与其一起运行的javascript文件。