windows下安装ffi老是失败

goldenMoon 发布于 2017/03/06 17:04
阅读 528
收藏 0

我安装了node python2.7 vs2013 不管用node-gyp还是nw-gyp都可以正确编译node c++ addOn,也就是运行环境应该没错吧,想要通过ffi调用dll文件,npm install ffi --save或npm install node-ffi --save一直不行啊
并且报了Can't find Python executable "F:\python2.7", you can set t
he PYTHON env variable.

我加到环境变量了啊!可以运行python
 


C:\Users\admin>python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (
Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

 

C:\Users\admin\Desktop\bc>npm install ffi --save

> ref@1.3.4 install C:\Users\admin\Desktop\bc\node_modules\ref
> node-gyp rebuild


C:\Users\admin\Desktop\bc\node_modules\ref>if not defined npm_config_node_gyp (n
ode "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modul
es\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "F:\python2.7", you can set t
he PYTHON env variable.

gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:356:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:117:15)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\admin\Desktop\bc\node_modules\ref
gyp ERR! node -v v6.2.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

 

加载中
0
goldenMoon
goldenMoon

python安了多个,最主要的Windows SDK没有装,现在安装后ffi ref模块可以安装,但是之前的例子nw-gyp build运行报错,再看看

返回顶部
顶部