理解`nvm ls`的输出.一切都安装正确了吗? [英] understanding the output of `nvm ls`. Is everything installed properly?

查看:47
本文介绍了理解`nvm ls`的输出.一切都安装正确了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我可能在nodejsnvm的安装过程中做了一些不好的事情.

I think I may have done something untoward during the install process of nodejs and nvm.

当我启动 bash 或打开终端时,我得到:

When I start bash or open a terminal I get:

:~$ bash
N/A: version "N/A -> N/A" is not yet installed.

You need to run "nvm install N/A" to install it before using it.

使用 nvm ls 从命令行我得到:

Using nvm ls from the command line I get:

回顾我的历史,我确实找到了两行我试图设置别名的行(我相信我是从我遵循的一组说明中得到的)

going through my history I did find two lines where I'd tried to set an alias (I do believe I got that from a set of instructions I was following)

据我所知,我没有任何错误,除了 bash 启动时,这些行是从 .bashrc 生成的:

As far as I know, I'm not having any errors, other than when bash starts up, and those lines are generated from .bashrc:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

我在这里的主要目的是了解 nvm ls 的输出以及是否有任何需要修复的内容.

My primary aim here is to understand the output of nvm ls and is there anything there that needs to be fixed.

另外一个好处是,我如何在登录时摆脱这些错误(除了简单地删除最后两行);)

A bonus aside is, how do I get rid of these errors on logging in (other than simply deleting the last two lines) ;)

我使用的是 ubuntu 17.04

I'm on ubuntu 17.04

在查看 Matt 回答中的链接后,我看到这些是我看到的说明.看来我在这里和那里错过了一点.这是我所做的以及到目前为止的结果:

After checking the link in Matt's answer I see that these are the instructions I saw. It appears I missed a little here and there. This is what I have done and the results so far:

nvm install iojs-v1.0.3

所以我已经清除了红色的 节点 ->稳定iojs ->不适用 行.它们现在是漂亮的绿色.我意识到第一个默认行是别名.

So I've cleared the red node -> stable and the iojs -> N/A lines. They're now a nice green. I realised the first default line was an alias.

完成所有这些额外的步骤终于摆脱了我的登录错误,所以这是一个加分项.

Doing all these extra steps has finally got rid of my login errors, so that's a plus.

我仍然想知道它们是否应该在那里,我是否做了一些让它们出现的操作,是否应该安装它们?没有安装它们有问题吗?

I'd still like to know should they be there, have I done something to make them appear, should they be installed? Is there a problem not having them installed?

关于它是如何设置的有趣的事情;我一直在运行节点和电子应用程序,没有任何问题!只会增加我的困惑.

The funny thing about how it has been setup; I have been running node and electron apps without any issue what so ever! Just adding to my confusion.

推荐答案

nvm 只是显示默认别名,即使没有为所有这些别名安装版本.

nvm is simply showing the default aliases, even though there are not versions installed for all those aliases.

默认情况下,nvm 不安装任何 Node 版本,但它带有以下别名:

By default, nvm doesn't install any Node versions, but it comes with the following aliases:

  • nodestable 指向 Node.js 的最新版本.
  • iojs 指向 io.js 的最新版本,这是 Node.js 的一个旧的未维护分支.
  • lts/aragon 指向最新版本的 Node LTS Aragon 系列(即 Node 4)
  • lts/boron 指向最新版本的 Node LTS Boron 系列(即 Node 6)
  • lts/* 指向 Node.js 的最新 LTS 版本,与 2017 年 8 月的 lts/boron 相同.(当 Node8 步进入 LTS)
  • node and stable point to the latest version of Node.js.
  • iojs points to the latest version of io.js, an old unmaintained fork of Node.js.
  • lts/aragon points to the latest version of the Node LTS Aragon line (which is Node 4)
  • lts/boron points to the latest version of the Node LTS Boron line (which is Node 6)
  • lts/* points to the latest LTS release of Node.js, which is the same as lts/boron as of Aug 2017. (This will change when Node 8 moves into LTS)

由于您没有安装任何 Node 版本,它表明这些别名不指向任何当前安装的 Node 版本,因此 N/A.

Since you don't have any Node versions installed, it shows that those aliases don't point to any currently installed Node version, hence the N/A.

如果您只想运行最新版本的 Node.js,只需运行 nvm install node.

If you just want to run the latest version of Node.js, just run nvm install node.

除非您需要,否则不要安装 iojs 或旧版本的 Node.js.只需忽略 N/A 输出,nvm 只是提醒您这些别名确实存在.

Don't bother installing iojs or older versions of Node.js unless you need them. Just ignore the N/A output, nvm is just reminding you that these aliases do exist.

这篇关于理解`nvm ls`的输出.一切都安装正确了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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