由于名称与另一个包冲突,nodeUbuntu上的NodeJS解释器名称()已重命名为nodejs.这是自述文件.Debian说:
Node.js解释器命令的上游名称是"node".在Debian中,解释器命令已更改为"nodejs".
这样做是为了防止命名空间冲突:其他命令在其上游使用相同的名称,例如来自"node"包的ax25-node.
必须将调用Node.js作为shell命令的脚本更改为使用"nodejs"命令.
但是,使用nodejs会破坏使用安装包npm.程序包安装失败,并显示以下错误:
Run Code Online (Sandbox Code Playgroud)sh: 1: node: not found npm WARN This failure might be due to the use of legacy binary "node" npm WARN For further explanations, please read /usr/share/doc/nodejs/README.Debian
如何让npm了解nodejs已安装在系统上,但解释器名称有所不同?