CNode

/bin/sh: 1: node: not found

问答
Yyakczh发布于11 年前最后回复11 年前4 回复11234 浏览0 收藏

apt-get install安装node以后,命令是nodejs 已经用alias 设置node='nodejs' 执行npm install 还是提示 : node: not found

npm install

contextify@0.1.14 install /home/dev/flux/node_modules/jest-cli/node_modules/jsdom/node_modules/contextify node-gyp rebuild

/bin/sh: 1: node: not found gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1

查看回复

回复 (4)

J
jysperm#1·11 年前

ln -s /usr/bin/nodejs /usr/bin/node

alias 并不总是可用

J
jysperm#2·11 年前

Ubuntu 的话可以:update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10 效果是一样的,只不过后者会通知 dpkg

D
dayuoba#3·11 年前

先把n装了吧

L
leapon#4·11 年前

有过类似情况,是系统已经有低版本的node占着地方了。解决方法是清干净,再重装node

参与回复
登录后即可参与回复。登录