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
ln -s /usr/bin/nodejs /usr/bin/node
alias 并不总是可用
Ubuntu 的话可以:update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
效果是一样的,只不过后者会通知 dpkg
先把n装了吧
有过类似情况,是系统已经有低版本的node占着地方了。解决方法是清干净,再重装node