安装 sqlite3 时出现问题 (..\src\database.cc(35):错误 C2248:'Napi::Env::DefaultFini':无法访问在 class 'Napi::Env' 中声明的私有成员
Problem install sqlite3 (..\src\database.cc(35): error C2248: 'Napi::Env::DefaultFini': cannot access private member declared in class 'Napi::Env'
我在创建 strap 应用程序时尝试安装 sqlite3 时遇到问题
我尝试:yarn install sqlite3 并尝试了很多方法但仍然无法正常工作
这是日志
创建 strapi 应用程序时安装 sqlite3 时出现问题 (..\src\database.cc(35):错误 C2248:'Napi::Env::DefaultFini':无法访问 class [=24= 中声明的私有成员] )
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: D:\my-project2\node_modules\sqlite3
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.11.0
node-pre-gyp info using node@12.20.1 | win32 | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "D:\my-project2\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node" (not found)
node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz
node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3@5.0.1 and node@12.20.1 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@12.20.1 | win32 | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@12.20.1 | win32 | x64
gyp info spawn C:Python27\python.exe
gyp info spawn args [
gyp info spawn args 'D:\my-project2\node_modules\node-gyp\gyp\gyp_main.py',
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@12.20.1 | win32 | x64
gyp info spawn C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe
gyp info spawn args [
gyp info spawn args 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. nothing.c
win_delay_load_hook.cc
nothing.vcxproj -> D:\my-project2\node_modules\sqlite3\build\Release\nothing.lib
unpack_sqlite_dep
sqlite3.c
win_delay_load_hook.cc
sqlite3.vcxproj -> D:\my-project2\node_modules\sqlite3\build\Release\sqlite3.lib
backup.cc
database.cc
node_sqlite3.cc
statement.cc
..\src\database.cc(35): error C2248: 'Napi::Env::DefaultFini': cannot access private member declared in class 'Napi::Env' [D:\my-project2\node_modules\sqlite3\build\node_sqlite3.vcxproj]
d:\my-project2\node_modules\node-addon-api\napi-inl.h(475): note: see declaration of 'Napi::Env::DefaultFini'
D:\my-project2\node_modules\node-addon-api\napi.h(168): note: see declaration of 'Napi::Env'
win_delay_load_hook.cc
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\my-project2\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\my-project2\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=D:\my-project2\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=D:\my-project2\node_modules\sqlite3\lib\binding\napi-v6-win32-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=6" "--node_napi_label=napi-v6"
gyp ERR! cwd D:\my-project2\node_modules\sqlite3
gyp ERR! node -v v12.20.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe D:\my-project2\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=D:\my-project2\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\my-project2\node_modules\sqlite3\lib\binding\napi-v6-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (D:\my-project2\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1022:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Windows_NT 10.0.18363
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\my-project2\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\my-project2\node_modules\sqlite3
node-pre-gyp ERR! node -v v12.20.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe D:\my-project2\node_modules\node-gyp\bin\node-gyp.js bu
我遇到了同样的问题。就我而言,我使用了 npm install sqlite3。
sqlite3(5.0.1) 尚未发布,因此可能存在一些错误。
我能够通过使用 npm install sqlite3@5.0.0 删除版本来安装它。
希望这对您有所帮助。
我在创建 strap 应用程序时尝试安装 sqlite3 时遇到问题
我尝试:yarn install sqlite3 并尝试了很多方法但仍然无法正常工作
这是日志
创建 strapi 应用程序时安装 sqlite3 时出现问题 (..\src\database.cc(35):错误 C2248:'Napi::Env::DefaultFini':无法访问 class [=24= 中声明的私有成员] )
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: D:\my-project2\node_modules\sqlite3
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.11.0
node-pre-gyp info using node@12.20.1 | win32 | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "D:\my-project2\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node" (not found)
node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz
node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for sqlite3@5.0.1 and node@12.20.1 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-win32-x64.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@12.20.1 | win32 | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@12.20.1 | win32 | x64
gyp info spawn C:Python27\python.exe
gyp info spawn args [
gyp info spawn args 'D:\my-project2\node_modules\node-gyp\gyp\gyp_main.py',
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@12.20.1 | win32 | x64
gyp info spawn C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe
gyp info spawn args [
gyp info spawn args 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. nothing.c
win_delay_load_hook.cc
nothing.vcxproj -> D:\my-project2\node_modules\sqlite3\build\Release\nothing.lib
unpack_sqlite_dep
sqlite3.c
win_delay_load_hook.cc
sqlite3.vcxproj -> D:\my-project2\node_modules\sqlite3\build\Release\sqlite3.lib
backup.cc
database.cc
node_sqlite3.cc
statement.cc
..\src\database.cc(35): error C2248: 'Napi::Env::DefaultFini': cannot access private member declared in class 'Napi::Env' [D:\my-project2\node_modules\sqlite3\build\node_sqlite3.vcxproj]
d:\my-project2\node_modules\node-addon-api\napi-inl.h(475): note: see declaration of 'Napi::Env::DefaultFini'
D:\my-project2\node_modules\node-addon-api\napi.h(168): note: see declaration of 'Napi::Env'
win_delay_load_hook.cc
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\my-project2\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\my-project2\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=D:\my-project2\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=D:\my-project2\node_modules\sqlite3\lib\binding\napi-v6-win32-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=6" "--node_napi_label=napi-v6"
gyp ERR! cwd D:\my-project2\node_modules\sqlite3
gyp ERR! node -v v12.20.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe D:\my-project2\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=D:\my-project2\node_modules\sqlite3\lib\binding\napi-v6-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=D:\my-project2\node_modules\sqlite3\lib\binding\napi-v6-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=6 --node_napi_label=napi-v6' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (D:\my-project2\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1022:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Windows_NT 10.0.18363
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\my-project2\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\my-project2\node_modules\sqlite3
node-pre-gyp ERR! node -v v12.20.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe D:\my-project2\node_modules\node-gyp\bin\node-gyp.js bu
我遇到了同样的问题。就我而言,我使用了 npm install sqlite3。 sqlite3(5.0.1) 尚未发布,因此可能存在一些错误。 我能够通过使用 npm install sqlite3@5.0.0 删除版本来安装它。 希望这对您有所帮助。