Nodejs 似乎不起作用;npm 确实有效,但是 [英] Nodejs seems to be not working; npm do work, however

查看:58
本文介绍了Nodejs 似乎不起作用;npm 确实有效,但是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一周前我正常运行 Node.js 和 Node-RED(取决于 Node.js).我的系统是 Windows 8.1 64 位.

I was running Node.js and Node-RED (depends on Node.js) normally one week ago. My system is Windows 8.1 64 bits.

尽管如此,今天我遇到了一个问题:

Nevertheless, today I am having a issue:

像往常一样,我转到 node-red 文件夹,然后运行 ​​node red.js.然后,令人惊讶的是,我从提示中收到了以下消息:

As normally, I go to the node-red folder, and run node red.js. Then, surprisingly I got the following message from the prompt:

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 nodes or node to offline state
        pause         - Pause node [deprecated]
        resume        - Resume node [deprecated]

For more information about HPC command-line tools,
see http://go.microsoft.com/fwlink/?LinkId=120724.

<小时>

所以,在评估了很多东西之后,比如环境变量、npm 和 node 文件夹等,它似乎没问题.但是,当我运行 npm -v 时,控制台会显示安装的 npm 版本.当我运行 node -v 时,我得到与上面相同的消息......我记得当我第一次安装 Node.js 时,我可以看到安装了 node.js 版本.


So, after evaluating many things, such as, environment variables, npm and node folders, etc it seems to be ok. BUT, when I run npm -v, the console shows the npm version installed. And when I run node -v, I get the same message as above... I remember when I first installed Node.js I could see the node.js version installed.

最近,我使用 Linux Ubuntu 14.04 进行了双启动,我认为这可能是问题所在(我进行了 CCLEANER 分析,删除了一些 Windows 寄存器).

In these days, I performed a dual boot with Linux Ubuntu 14.04 and I think this is may the problem (I performed I CCLEANER analysis that remove some Windows registers).

目前,与它们相关的我的个人/用户路径变量是:C:\Program Files\nodejs

Currently, my personal/user path variables related to them are: C:\Program Files\nodejs

系统环境变量为:C:\Program Files\nodejs

附注:

  • Node.js 控制台 (node.exe) 正常打开.
  • 我尝试以管理员身份和我的用户运行提示.
  • 我需要运行 0.10x 版本的 node.js.并且此问题与此版本 (0.10x) 有关.

谢谢.

推荐答案

您很可能拥有 Microsoft HPC Pack 已安装,它有自己的 node.exe,并且正在选择这个可执行文件.

Most likely you have the Microsoft HPC Pack installed, which has its own node.exe and it's this executable that is being picked.

如果您不使用它,我建议您将其删除以减少混淆.否则,如果您确定已从 node.js 网站(例如 Windows 安装程序)安装了 node.js,请执行确保 %PATH% 中的 node.js 路径位于 Microsoft HPC Pack 的 node.exe 路径之前,以确保它选择正确"的 node.exe.

If you're not using that, I'd suggest removing it to make things less confusing. Otherwise if you're sure you have installed node.js from the node.js website (e.g. the Windows installer), then make sure that the node.js path in your %PATH% comes before the path for Microsoft HPC Pack's node.exe to make sure it picks up the "right" node.exe.

这篇关于Nodejs 似乎不起作用;npm 确实有效,但是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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