gpt4 book ai didi

node.js - 使用 "node"初始化脚本不起作用,而 "nodejs"可以

转载 作者:太空宇宙 更新时间:2023-11-03 17:00:34 28 4
gpt4 key购买 nike

我关注了installation instructions并成功安装在 Ubuntu 机器上。但是,当我尝试使用命令 node -v 检查版本时,它不会返回任何内容,但当我输入 nodejs -v 时,它会给出版本。脚本的执行也是如此,如果我给 node hello.js 没有任何反应,但是当我给 nodejs hello.js 时,文件会执行。

我在各种网站上进行了在线检查,发现他们使用的是 node 而不是 nodejs。我和一位 friend 核对过,她也从同一位置安装过,甚至她在 node 上运行,当她试图给 nodejs 时,它说找不到命令。我也没有发现任何与此相关的记录问题。感谢您的帮助。

我只是想确认以下是问题的原因吗?

There is a naming conflict with the node package (Amateur Packet Radio Node Program), and the nodejs binary has been renamed from node to nodejs. You'll need to symlink /usr/bin/node to /usr/bin/nodejs or you could uninstall the Amateur Packet Radio Node Program to avoid that conflict.

最佳答案

是的,这是一个已知问题。你可以读到那个 here ,问题也发布在 GitHub 上.

来自 Debian.org 的回应:

The nodejs package shall be changed to provide /usr/bin/nodejs, not /usr/bin/node. The package shall declare a Breaks: relationship with any packages in Debian that reference /usr/bin/node.

关于node.js - 使用 "node"初始化脚本不起作用,而 "nodejs"可以,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15695914/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com