我正在尝试安装npm软件包来传输433Mhz代码以控制某些射频插座。该程序包称为rpi-433,我之前曾多次使用它。但是我现在无法安装它。如果执行npm install,则会收到此错误消息。
错误日志:
> rpi-433@2.1.0 install /home/pi/home_control_server/node_modules/rpi-433
> mkdir ./build && cd ./src && /usr/bin/make
g++ -c -o RCSwitch.o RCSwitch.cpp
RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordB(int, int, boolean)’:
RCSwitch.cpp:196:12: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
return '\0';
^~~~
RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordA(char*, int, boolean)’:
RCSwitch.cpp:232:14: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
return '\0';
^~~~
RCSwitch.cpp:241:14: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
return '\0';
^~~~
RCSwitch.cpp: In member function ‘char* RCSwitch::getCodeWordC(char, int, int, boolean)’:
RCSwitch.cpp:269:12: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive]
return '\0';
^~~~
RCSwitch.cpp: In static member function ‘static bool RCSwitch::receiveProtocol1(unsigned int)’:
RCSwitch.cpp:524:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
RCSwitch.cpp: In static member function ‘static bool RCSwitch::receiveProtocol2(unsigned int)’:
RCSwitch.cpp:559:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make: *** [<builtin>: RCSwitch.o] Error 1
npm WARN server@1.0.0 No description
npm WARN server@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! rpi-433@2.1.0 install: `mkdir ./build && cd ./src && /usr/bin/make`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the rpi-433@2.1.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我曾尝试搜索替代方案或修补程序,但不是在包管理器中查找。有人知道吗?