在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 --python
variable:
$ node-gyp --python /user/bin/python2.7
If node-gyp
is called by way of npm
, and 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
- 本文固定链接: http://www.letg.top/?p=82
- 转载请注明: ubosm 于 点滴分享 发表