在用react,electron,创建的程序时可以运行的,当添加sqlite3时,编译就过不去了,因为sqlite3是C++写的,所以在使用的时候我们不能直接用,需要编译下才可以使用,但是这个编译过程有些难走。
首先下载了electron-rebuild
npm install --save-dev electron-rebuild
然后,下载了sqlite3
npm install --save sqlite3
随后修改了package.json: //在scripts命令中添加此条
"scripts": {
"rebuild": "electron-rebuild -f -w sqlite3"
},
然后运行编译:
npm run rebuild
遇到了如下的错误:
zoe@DESKTOP-MEP5D54 MINGW64 /e/aPritice/appelectronnfc
$ npm run rebuild
> [email protected] rebuild E:\aPritice\appelectronnfc
> electron-rebuild -f -w sqlite3
- Searching dependency tree
× Rebuild Failed
An unhandled error occurred inside electron-rebuild
�ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�/m�����ء�
buffertools.cc
win_delay_load_hook.cc
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(4458): warning C4996: 'v8::WasmModuleObject::SerializedModule': ������Ϊ�ѷ�� (����Դ�ļ� ..\buffertools.cc) [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(4380): note: �μ���v8::WasmModuleObject::SerializedModule�������� (����Դ�ļ� ..\buffertools.cc)
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(10172): warning C4996: 'v8::Value::ToBoolean': ������Ϊ�ѷ�� (����Դ�ļ� ..\buffertools.cc) [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2387): note: �μ���v8::Value::ToBoolean�������� (����Դ�ļ� ..\buffertools.cc)
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(32): error C2039: ��Handle��: ���ǡ�v8���ij�Ա [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8-platform.h(16): note: ���v8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(32): error C2873: ��Handle��: ���Ų������� using ������ [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(256): warning C4996: 'v8::Value::Int32Value': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2446): note: ���v8::Value::Int32Value��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(261): warning C4996: 'v8::String::Utf8Value::Utf8Value': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2893): note: ���v8::String::Utf8Value::Utf8Value��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(266): warning C4996: 'v8::Value::ToObject': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(10183): note: ���v8::Value::ToObject��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(272): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(329): warning C4996: 'v8::Value::Int32Value': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2446): note: ���v8::Value::Int32Value��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(363): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(381): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(419): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(449): warning C4996: 'v8::String::Utf8Length': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2556): note: ���v8::String::Utf8Length��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(452): warning C4996: 'v8::Value::ToObject': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(10183): note: ���v8::Value::ToObject��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(460): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(470): warning C4996: 'v8::String::Utf8Value::Utf8Value': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2893): note: ���v8::String::Utf8Value::Utf8Value��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(475): warning C4996: 'v8::Value::ToObject': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(10183): note: ���v8::Value::ToObject��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(482): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(492): error C2065: ��Handle��: δ�����ı�ʶ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(492): error C2275: ��v8::Object��: ����������������ʽ�Ƿ� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(3257): note: ���v8::Object��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(492): error C2065: ��target��: δ�����ı�ʶ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(492): error C2182: ��RegisterModule��: �Ƿ�ʹ�á�void������ [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(492): error C2448: ��`anonymous-namespace'::RegisterModule��: ������ʽ��ʼֵ�趨�����ƺ������� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(506): warning C4312: ������ǿ��ת����: �ӡ�int��ת��������ġ�node::addon_register_func�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (E:\aPritice\appelectronnfc\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\aPritice\\appelectronnfc\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=5.0.1" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd E:\aPritice\appelectronnfc\node_modules\buffertools
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Failed with exit code: 1
Error: �ڴ˽��������һ������һ����Ŀ����Ҫ���ò������ɣ������ӡ�/m�����ء�
buffertools.cc
win_delay_load_hook.cc
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(4458): warning C4996: 'v8::WasmModuleObject::SerializedModule': ������Ϊ�ѷ�� (����Դ�ļ� ..\buffertools.cc) [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(4380): note: �μ���v8::WasmModuleObject::SerializedModule�������� (����Դ�ļ� ..\buffertools.cc)
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(10172): warning C4996: 'v8::Value::ToBoolean': ������Ϊ�ѷ�� (����Դ�ļ� ..\buffertools.cc) [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2387): note: �μ���v8::Value::ToBoolean�������� (����Դ�ļ� ..\buffertools.cc)
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(32): error C2039: ��Handle��: ���ǡ�v8���ij�Ա [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8-platform.h(16): note: ���v8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(32): error C2873: ��Handle��: ���Ų������� using ������ [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(256): warning C4996: 'v8::Value::Int32Value': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2446): note: ���v8::Value::Int32Value��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(261): warning C4996: 'v8::String::Utf8Value::Utf8Value': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2893): note: ���v8::String::Utf8Value::Utf8Value��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(266): warning C4996: 'v8::Value::ToObject': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(10183): note: ���v8::Value::ToObject��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(272): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(329): warning C4996: 'v8::Value::Int32Value': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2446): note: ���v8::Value::Int32Value��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(363): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(381): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(419): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(449): warning C4996: 'v8::String::Utf8Length': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2556): note: ���v8::String::Utf8Length��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(452): warning C4996: 'v8::Value::ToObject': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(10183): note: ���v8::Value::ToObject��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(460): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(470): warning C4996: 'v8::String::Utf8Value::Utf8Value': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2893): note: ���v8::String::Utf8Value::Utf8Value��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(475): warning C4996: 'v8::Value::ToObject': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(10183): note: ���v8::Value::ToObject��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(482): warning C4996: 'v8::String::NewFromUtf8': ������Ϊ�ѷ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(2785): note: ���v8::String::NewFromUtf8��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(492): error C2065: ��Handle��: δ�����ı�ʶ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(492): error C2275: ��v8::Object��: ����������������ʽ�Ƿ� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
c:\users\zoe\.electron-gyp\5.0.1\include\node\v8.h(3257): note: ���v8::Object��������
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(492): error C2065: ��target��: δ�����ı�ʶ�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(492): error C2182: ��RegisterModule��: �Ƿ�ʹ�á�void������ [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(492): error C2448: ��`anonymous-namespace'::RegisterModule��: ������ʽ��ʼֵ�趨�����ƺ������� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
e:\apritice\appelectronnfc\node_modules\buffertools\buffertools.cc(506): warning C4312: ������ǿ��ת����: �ӡ�int��ת��������ġ�node::addon_register_func�� [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (E:\aPritice\appelectronnfc\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\aPritice\\appelectronnfc\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=5.0.1" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd E:\aPritice\appelectronnfc\node_modules\buffertools
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Failed with exit code: 1
at SafeSubscriber._error (E:\aPritice\appelectronnfc\node_modules\spawn-rx\lib\src\index.js:267:84)
at SafeSubscriber.__tryOrUnsub (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:205:16)
at SafeSubscriber.error (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:156:26)
at Subscriber._error (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:92:26)
at Subscriber.error (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:72:18)
at MapSubscriber.Subscriber._error (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:92:26)
at MapSubscriber.Subscriber.error (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:72:18)
at SafeSubscriber._next (E:\aPritice\appelectronnfc\node_modules\spawn-rx\lib\src\index.js:242:65)
at SafeSubscriber.__tryOrUnsub (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:205:16)
at SafeSubscriber.next (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:143:22)
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! [email protected] rebuild: `electron-rebuild -f -w sqlite3`
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the [email protected] rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\zoe\AppData\Roaming\npm-cache\_logs\2019-05-08T06_13_49_823Z-debug.log
编译失败了,重新找方法,继续:
看了苏南大叔的文章:
使用cnpm的一条命令,进行,我这本身没有cnpm ,所以先下载(-g是全局下载,我是下了局部的,所以下一条命令,我使用的npx cnpm …)
npm install -g cnpm --registry=https://registry.npm.taobao.org
下载完,可以 cnpm -v
看下cnpm的版本,
然后执行这条命令试下:
cnpm install sqlite3@latest --build-from-source --runtime=electron --target=1.7.9 --dist-url=https://atom.io/download/electron --save
随后我执行了npm run rebuild
得到了
cnpm好像不行,我缺包,删除sqlite3
npm uninstall sqlite3 --save
重新用npm 试下:
先换下淘宝镜像地址:
npm config set registry http://registry.npm.taobao.org
然后输入命令重新下载
–target=后跟的是你的electron的版本,你可使用electron -v
查看
npm install sqlite3 --build-from-source --runtime=electron --target=4.0.3 --dist-url=https://atom.io/download/electron --save-dev
下载完,运行:npm run rebuild
但是得到的结果
删除包 rm -rf node_modules/
重新下载:npm install
结果不理想…
重新编译,又回到了文章的起点报错…
如果你不想看到乱码的提示,可以尝试这个:
可以把chcp 65001作为你npm命令的一部分,也许是个可行的解决方案。就可以看到熟悉的汉字了
"rebuild": "chcp 65001 && electron-rebuild -f -w sqlite3"
npm cache clean -f
重新下载
npm uninstall node-gyp -g
npm uninstall node-gyp
npm install node-gyp -g
npx cnpm install sqlite3@latest --build-from-source --runtime=electron --target=4.0.3 --dist-url=https://atom.io/download/electron --save
下载完成
$ npx cnpm install sqlite3@latest --build-from-source --runtime=electron --target=4.0.3 --dist-url=https://atom.io/download/electron --save
√ Installed 1 packages
√ Linked 110 latest versions
[1/1] scripts.install sqlite3@latest run "node-pre-gyp install --fallback-to-build", root: "E:\\aPritice\\appelectronnfc\\node_modules\\[email protected]@sqlite3"
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp http GET https://cdn.npm.taobao.org/dist/sqlite3/v4.0.7/electron-v4.0-win32-x64.tar.gz
node-pre-gyp http 404 https://cdn.npm.taobao.org/dist/sqlite3/v4.0.7/electron-v4.0-win32-x64.tar.gz
node-pre-gyp WARN Tried to download(404): https://cdn.npm.taobao.org/dist/sqlite3/v4.0.7/electron-v4.0-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (electron-v4.0 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://cdn.npm.taobao.org/dist/sqlite3/v4.0.7/electron-v4.0-win32-x64.tar.gz
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
unpack_sqlite_dep
sqlite3.c
win_delay_load_hook.cc
sqlite3.vcxproj -> E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\Release\\sqlite3.lib
backup.cc
database.cc
node_sqlite3.cc
statement.cc
..\src\statement.cc(103): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\statement.cc(161): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(347): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(412): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(416): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(483): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(556): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(564): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(680): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(694): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(743): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(837): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(873): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\statement.cc(887): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\backup.cc(105): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\backup.cc(119): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\database.cc(49): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\backup.cc(167): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明..\src\database.cc(63): warning C4996: 'Nan::MakeCallback': 被声明为已否决
..\src\backup.cc(168): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\backup.cc(169): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明..\src\database.cc(92): warning C4996: 'Nan::MakeCallback': 被声明为已否决
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明..\src\backup.cc(170): warning C4996: 'Nan::ForceSet': 被声明为已否决
..\src\database.cc(96): warning C4996: 'Nan::MakeCallback': 被声明为已否决e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\backup.cc(236): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明..\src\database.cc(133): warning C4996: 'Nan::ForceSet': 被声明为已否决
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明..\src\backup.cc(301): warning C4996: 'Nan::MakeCallback': 被声明为已否决
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明..\src\database.cc(134): warning C4996: 'Nan::ForceSet': 被声明为已否决
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\backup.cc(336): warning C4996: 'Nan::MakeCallback': 被声明为已否决..\src\database.cc(190): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\database.cc(194): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\node_sqlite3.cc(23): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明..\src\database.cc(199): warning C4996: 'Nan::MakeCallback': 被声明为已否决
..\src\node_sqlite3.cc(24): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明..\src\database.cc(273): warning C4996: 'Nan::MakeCallback': 被声明为已否决
..\src\node_sqlite3.cc(25): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明..\src\database.cc(277): warning C4996: 'Nan::MakeCallback': 被声明为已否决
..\src\node_sqlite3.cc(26): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明..\src\database.cc(282): warning C4996: 'Nan::MakeCallback': 被声明为已否决
..\src\node_sqlite3.cc(27): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\database.cc(297): warning C4996: 'Nan::MakeCallback': 被声明为已否决..\src\node_sqlite3.cc(28): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\database.cc(314): warning C4996: 'Nan::MakeCallback': 被声明为已否决..\src\node_sqlite3.cc(29): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\statement.cc(74): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\node_sqlite3.cc(30): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明..\src\statement.cc(153): note: 参见对正在编译的函数 模板 实例化“void node_sqlite3::Statement::Error(T *)”的引用
with
[
T=node_sqlite3::Statement::PrepareBaton
]
..\src\node_sqlite3.cc(32): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\statement.cc(78): warning C4996: 'Nan::MakeCallback': 被声明为已否决e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\node_sqlite3.cc(34): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(36): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\database.cc(421): warning C4996: 'Nan::MakeCallback': 被声明为已否决e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明..\src\node_sqlite3.cc(37): warning C4996: 'Nan::ForceSet': 被声明为已否决
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(38): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(39): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(40): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(41): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(42): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\database.cc(462): warning C4996: 'Nan::MakeCallback': 被声明为已否决e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\node_sqlite3.cc(43): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(44): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(45): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(46): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\database.cc(507): warning C4996: 'Nan::MakeCallback': 被声明为已否决e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\node_sqlite3.cc(47): warning C4996: 'Nan::ForceSet': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(48): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(49): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\database.cc(564): warning C4996: 'Nan::MakeCallback': 被声明为已否决..\src\node_sqlite3.cc(50): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\node_sqlite3.cc(51): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明..\src\database.cc(568): warning C4996: 'Nan::MakeCallback': 被声明为已否决
..\src\node_sqlite3.cc(52): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明..\src\node_sqlite3.cc(53): warning C4996: 'Nan::ForceSet': 被声明为已否决
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\database.cc(573): warning C4996: 'Nan::MakeCallback': 被声明为已否决..\src\node_sqlite3.cc(54): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\node_sqlite3.cc(55): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\database.cc(603): warning C4996: 'Nan::MakeCallback': 被声明为已否决..\src\node_sqlite3.cc(56): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\node_sqlite3.cc(57): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(58): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\database.cc(666): warning C4996: 'Nan::MakeCallback': 被声明为已否决e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\node_sqlite3.cc(59): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(60): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\database.cc(670): warning C4996: 'Nan::MakeCallback': 被声明为已否决e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
..\src\node_sqlite3.cc(61): warning C4996: 'Nan::ForceSet': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\node_sqlite3.cc(62): warning C4996: 'Nan::ForceSet': 被声明为已否决..\src\database.cc(675): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
e:\apritice\appelectronnfc\node_modules\[email protected]@nan\nan_maybe_43_inl.h(130): note: 参见“Nan::ForceSet”的声明
..\src\backup.cc(78): warning C4996: 'Nan::MakeCallback': 被声明为已否决E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
..\src\backup.cc(228): note: 参见对正在编译的函数 模板 实例化“void node_sqlite3::Backup::Error(T *)”的引用
with
[
T=node_sqlite3::Backup::InitializeBaton
]
..\src\backup.cc(82): warning C4996: 'Nan::MakeCallback': 被声明为已否决 [E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\node_sqlite3.vcxproj]
E:\aPritice\appelectronnfc\node_modules\[email protected]@nan\nan.h(959): note: 参见“Nan::MakeCallback”的声明
win_delay_load_hook.cc
正在创建库 E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\Release\node_sqlite3.lib 和对象 E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\Release\node_sqlite3.exp
正在生成代码
All 4564 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
已完成代码的生成
node_sqlite3.vcxproj -> E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\Release\\node_sqlite3.node
node_sqlite3.vcxproj -> E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\Release\node_sqlite3.pdb (Full PDB)
Copying E:\aPritice\appelectronnfc\node_modules\[email protected]@sqlite3\build\Release\/node_sqlite3.node to E:/aPritice/appelectronnfc/node_modules/[email protected]@sqlite3/lib/binding/electron-v4.0-win32-x64\node_sqlite3.node
已复制 1 个文件。
[1/1] scripts.install sqlite3@latest finished in 37s
√ Run 1 scripts
Recently updated (since 2019-05-03): 2 packages (detail see file E:\aPritice\appelectronnfc\node_modules\.recently_updates.txt)
√ All packages installed (118 packages installed from npm registry, used 54s(network 18s), speed 1.24MB/s, json 111(212.28kB), tarball 21.71MB)
重新编译
$ npm run rebuild
> [email protected] rebuild E:\aPritice\appelectronnfc
> chcp 65001 && electron-rebuild -f -w sqlite3
Active code page: 65001
- Searching dependency tree
× Rebuild Failed
An unhandled error occurred inside electron-rebuild
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v120 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, please install v120 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (E:\aPritice\appelectronnfc\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\aPritice\\appelectronnfc\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=5.0.1" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd E:\aPritice\appelectronnfc\node_modules\buffertools
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Failed with exit code: 1
Error: 在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build tools for v120 (Platform Toolset = 'v120') cannot be found. To build using the v120 build tools, please install v120 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [E:\aPritice\appelectronnfc\node_modules\buffertools\build\buffertools.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (E:\aPritice\appelectronnfc\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\aPritice\\appelectronnfc\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=5.0.1" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source"
gyp ERR! cwd E:\aPritice\appelectronnfc\node_modules\buffertools
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Failed with exit code: 1
at SafeSubscriber._error (E:\aPritice\appelectronnfc\node_modules\spawn-rx\lib\src\index.js:267:84)
at SafeSubscriber.__tryOrUnsub (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:205:16)
at SafeSubscriber.error (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:156:26)
at Subscriber._error (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:92:26)
at Subscriber.error (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:72:18)
at MapSubscriber.Subscriber._error (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:92:26)
at MapSubscriber.Subscriber.error (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:72:18)
at SafeSubscriber._next (E:\aPritice\appelectronnfc\node_modules\spawn-rx\lib\src\index.js:242:65)
at SafeSubscriber.__tryOrUnsub (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:205:16)
at SafeSubscriber.next (E:\aPritice\appelectronnfc\node_modules\rxjs\internal\Subscriber.js:143:22)
npm ERR! code ELIFECYCLE
npm ERR! errno 4294967295
npm ERR! [email protected] rebuild: `chcp 65001 && electron-rebuild -f -w sqlite3`
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the [email protected] rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\zoe\AppData\Roaming\npm-cache\_logs\2019-05-10T03_05_15_050Z-debug.log
出来的,暂且搁置吧,等页面做完了在看这个
后有人告诉我,使用node-gyp进行编译:
编译步骤
保证你下安装了 Python以及c++编译环境,node-gyp 。
1.1:安装 python2.7。python 若是有问题,如果之前安装过多个版本,则必须 npm config set python “/path/python.exe”。必须为2.7版本。
1.2:安装 Visual Studio 2015 ,安装过程中需要安装c++相关,必须安装。
1.3:安装 windows-build-tools。 npm install windows-build-tools -g 。如果npm 不行,运行 cnpm install windows-build-tools -g。 windows build 错误时,需要重新安装vs2015。
1.4:安装 node-pre-gyp 和 node-gyp。 npm install node-pre-gyp -g npm install node-gyp -g。
npm uninstall node-gyp -g
npm uninstall node-gyp
npm install node-gyp -g
C++的编译环境可运行一条命令:
我是手动下载了Visual stadio的工具,把C++的选了,安装完成
npm install windows-build-tools -g
第一步:
先在你的项目里面安装npm install sqlite3 -s。
成功之后,在你的node_modules 里面会有一个sqlite3的文件。
里面的这个文件:
node_modules/sqlite3/binding.gyp
就是我们需要编译成electron模块的配置文件。里面有两个变量:module_name、module_path 这个很重要需要我们编译的时候传入。
第二步:
cd到 sqlite3 目录下:
运行:node-gyp rebuild --target=5.0.0 --arch=ia32 --target_platform=win32 --dist-url=https://atom.io/download/atom-shell --module_name=node_sqlite3 --module_path=../lib/binding/electron-v5.0-win32-ia32
上面参数:
target代表你的electron 版本号,默认你的node_modules/下的electron 版本 PS:我的版本是5.0.0。
arch代表你的node位数,PS:我的是32位,64位node写x64。
module_path:这个参数
electron-v5.0-win32-ia32,这个名字需要注意:v5.0是electron版本,ia32 和 arch参数对应。
好,我们运行这条命令
编译成功,会看到在splite3 里面lib包下有:
这个就是我们需要的electron sqlit3 模块;
测试一下:在main.js 添加sqlite3
运行测试一下:
测试成功!!!
参考网址:https://www.cnblogs.com/wyuan-yuan/p/10451156.html