我试图重新设定短划线按钮以向手机发送短信。我尝试尝试的任务位于此处:https://github.com/sanzgiri/dash-sms。以下是我收到的错误消息的副本。任何见解都非常感谢。我在虚拟机中使用Ubuntu 16版。
rebecca@rebecca-VirtualBox:~$ sudo npm install node-dash-button
> socketwatcher@0.3.0 install /home/rebecca/node_modules/socketwatcher
> node-gyp rebuild
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node- gyp/lib/configure.js:354:16)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-21-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/rebecca/node_modules/socketwatcher
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-dash-button"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! socketwatcher@0.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the socketwatcher@0.3.0 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the socketwatcher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs socketwatcher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls socketwatcher
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/rebecca/npm-debug.log
答案 0 :(得分:1)
我认为代码很适合使用“node”而不是“nodejs”。 您可以设置simlink或只运行此命令。它为我解决了这个问题。
sudo apt install nodejs-legacy
答案 1 :(得分:0)
有同样的问题,什么都行不通。最后不得不去pi的节点0.10.26。
使用NVM而不是直接节点安装。
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash的
nvm install 0.10.26