Node forever /usr/bin/env: node: No such file or directory

后端 未结 3 998
粉色の甜心
粉色の甜心 2020-12-04 08:45

I have installed nodejs using:

apt-get install nodejs

Then i have installed npm using:

apt-get install npm
<
3条回答
  •  醉梦人生
    2020-12-04 09:36

    While the accepted answer fixes the problem, the correct way to do that, at least with Debian Jessie and forward and Ubuntu 14.4 and forward1 is to install nodejs-legacy:

    apt-get install nodejs-legacy
    

    The reason is that Debian already had a package (node) providing /usr/bin/node, and the nodejs node binary had to be installed into /usr/bin/nodejs.

    The nodejs-legacy package provides a symbolic link from /usr/bin/nodejs to /usr/bin/node (and conflicts with the node package).

    Source: [CTTE #614907] Resolution of node/nodejs conflict and Debian bug #614907: node: name conflicts with node.js interpreter

提交回复
热议问题