点滴分享

九月 | 2019 | 点滴分享

Archive for 九月, 2019

ubuntu下nodejs编译C++ addon错误解决

在linux下编译nodejs 的C++ addon ,在windows下都是OK的,结果到了ubuntu下反而报错了,错误大概如下:

gyp ERR! Completion callback never invoked

搞了很久,各种搜索都找不到方法,后边进github里面看了下readme,尝试把npm 和node-pyg的pyhon路径设置了一下就可以了。

Configuring Python Dependency配置依赖

If you have multiple Python versions installed, you can identify which Python version node-gyp uses by setting the --pythonvariable:

$ node-gyp --python /user/bin/python2.7

If node-gyp is called by way of npmand you have multiple versions of Python installed, then you can set npm‘s ‘python’ config key to the appropriate value:

$ npm config set python /user/bin/python2.7

 

2019年9月24日 0 / /
标签:  暂无标签
回到顶部