非常感谢您的帮助。
我没有通过您的建议解决它,但它仍然为我指明了有用的方向。我最终再次卸载了 npm 并随后手动安装了所有附加组件。命令npm install sqlite3还是报错如下:
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Pre-built binaries not installable for sqlite3@5.0.0 and node@12.18.3 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error getaddrinfo ENOTFOUND mapbox-node-binary.s3.amazonaws.com
CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
LIBTOOL-STATIC Release/nothing.a
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c
TOUCH Release/obj.target/deps/action_before_build.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3310100/sqlite3.o
LIBTOOL-STATIC Release/sqlite3.a
CXX(target) Release/obj.target/node_sqlite3/src/backup.o
../src/backup.cc:191:9: warning: unused variable 'status' [-Wunused-variable]
int status = napi_create_async_work(
^
../src/backup.cc:263:5: warning: unused variable 'status' [-Wunused-variable]
BACKUP_BEGIN(Step);
^
../src/macros.h:175:9: note: expanded from macro 'BACKUP_BEGIN'
int status = napi_create_async_work( \
^
../src/backup.cc:329:5: warning: unused variable 'status' [-Wunused-variable]
BACKUP_BEGIN(Finish);
^
../src/macros.h:175:9: note: expanded from macro 'BACKUP_BEGIN'
int status = napi_create_async_work( \
^
3 warnings generated.
CXX(target) Release/obj.target/node_sqlite3/src/database.o
../src/database.cc:144:9: warning: unused variable 'status' [-Wunused-variable]
int status = napi_create_async_work(
^
../src/database.cc:240:9: warning: unused variable 'status' [-Wunused-variable]
int status = napi_create_async_work(
^
../src/database.cc:557:9: warning: unused variable 'status' [-Wunused-variable]
int status = napi_create_async_work(
^
../src/database.cc:667:9: warning: unused variable 'status' [-Wunused-variable]
int status = napi_create_async_work(
^
4 warnings generated.
CXX(target) Release/obj.target/node_sqlite3/src/node_sqlite3.o
CXX(target) Release/obj.target/node_sqlite3/src/statement.o
../src/statement.cc:35:21: warning: result of comparison against a string literal is unspecified (use strncmp instead)
[-Wstring-compare]
if (object_type == "Date") {
^ ~~~~~~
../src/statement.cc:37:28: warning: result of comparison against a string literal is unspecified (use strncmp instead)
[-Wstring-compare]
} else if (object_type == "RegExp") {
^ ~~~~~~~~
../src/statement.cc:128:9: warning: unused variable 'status' [-Wunused-variable]
int status = napi_create_async_work(
^
../src/statement.cc:188:51: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (OtherInstanceOf(source.As<Object>(), "RegExp")) {
^
../src/statement.cc:209:51: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (OtherInstanceOf(source.As<Object>(), "Date")) {
^
../src/statement.cc:243:87: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (!info[start].IsObject() || OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[star...
^
../src/statement.cc:243:142: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
...|| OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[start].As<Object>(), "Date") || info[start].I...
^
../src/statement.cc:349:5: warning: unused variable 'status' [-Wunused-variable]
STATEMENT_BEGIN(Bind);
^
../src/macros.h:145:9: note: expanded from macro 'STATEMENT_BEGIN'
int status = napi_create_async_work( \
^
../src/statement.cc:400:5: warning: unused variable 'status' [-Wunused-variable]
STATEMENT_BEGIN(Get);
^
../src/macros.h:145:9: note: expanded from macro 'STATEMENT_BEGIN'
int status = napi_create_async_work( \
^
../src/statement.cc:471:5: warning: unused variable 'status' [-Wunused-variable]
STATEMENT_BEGIN(Run);
^
../src/macros.h:145:9: note: expanded from macro 'STATEMENT_BEGIN'
int status = napi_create_async_work( \
^
../src/statement.cc:540:5: warning: unused variable 'status' [-Wunused-variable]
STATEMENT_BEGIN(All);
^
../src/macros.h:145:9: note: expanded from macro 'STATEMENT_BEGIN'
int status = napi_create_async_work( \
^
../src/statement.cc:640:5: warning: unused variable 'status' [-Wunused-variable]
STATEMENT_BEGIN(Each);
^
../src/macros.h:145:9: note: expanded from macro 'STATEMENT_BEGIN'
int status = napi_create_async_work( \
^
../src/statement.cc:766:5: warning: unused variable 'status' [-Wunused-variable]
STATEMENT_BEGIN(Reset);
^
../src/macros.h:145:9: note: expanded from macro 'STATEMENT_BEGIN'
int status = napi_create_async_work( \
^
../src/statement.cc:243:87: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (!info[start].IsObject() || OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[star...
^
../src/statement.cc:337:26: note: in instantiation of function template specialization
'node_sqlite3::Statement::Bind<node_sqlite3::Statement::Baton>' requested here
Baton* baton = stmt->Bind<Baton>(info);
^
../src/statement.cc:243:142: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
...|| OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[start].As<Object>(), "Date") || info[start].I...
^
../src/statement.cc:188:51: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (OtherInstanceOf(source.As<Object>(), "RegExp")) {
^
../src/statement.cc:240:45: note: in instantiation of function template specialization 'node_sqlite3::Statement::BindParameter<int>'
requested here
baton->parameters.push_back(BindParameter((array).Get(i), pos));
^
../src/statement.cc:337:26: note: in instantiation of function template specialization
'node_sqlite3::Statement::Bind<node_sqlite3::Statement::Baton>' requested here
Baton* baton = stmt->Bind<Baton>(info);
^
../src/statement.cc:209:51: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (OtherInstanceOf(source.As<Object>(), "Date")) {
^
../src/statement.cc:188:51: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (OtherInstanceOf(source.As<Object>(), "RegExp")) {
^
../src/statement.cc:263:49: note: in instantiation of function template specialization 'node_sqlite3::Statement::BindParameter<const
char *>' requested here
baton->parameters.push_back(BindParameter((object).Get(name),
^
../src/statement.cc:337:26: note: in instantiation of function template specialization
'node_sqlite3::Statement::Bind<node_sqlite3::Statement::Baton>' requested here
Baton* baton = stmt->Bind<Baton>(info);
^
../src/statement.cc:209:51: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (OtherInstanceOf(source.As<Object>(), "Date")) {
^
../src/statement.cc:243:87: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (!info[start].IsObject() || OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[star...
^
../src/statement.cc:388:26: note: in instantiation of function template specialization
'node_sqlite3::Statement::Bind<node_sqlite3::Statement::RowBaton>' requested here
Baton* baton = stmt->Bind<RowBaton>(info);
^
../src/statement.cc:243:142: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
...|| OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[start].As<Object>(), "Date") || info[start].I...
^
../src/statement.cc:243:87: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (!info[start].IsObject() || OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[star...
^
../src/statement.cc:459:26: note: in instantiation of function template specialization
'node_sqlite3::Statement::Bind<node_sqlite3::Statement::RunBaton>' requested here
Baton* baton = stmt->Bind<RunBaton>(info);
^
../src/statement.cc:243:142: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
...|| OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[start].As<Object>(), "Date") || info[start].I...
^
../src/statement.cc:243:87: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (!info[start].IsObject() || OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[star...
^
../src/statement.cc:528:26: note: in instantiation of function template specialization
'node_sqlite3::Statement::Bind<node_sqlite3::Statement::RowsBaton>' requested here
Baton* baton = stmt->Bind<RowsBaton>(info);
^
../src/statement.cc:243:142: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
...|| OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[start].As<Object>(), "Date") || info[start].I...
^
../src/statement.cc:243:87: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
else if (!info[start].IsObject() || OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[star...
^
../src/statement.cc:620:30: note: in instantiation of function template specialization
'node_sqlite3::Statement::Bind<node_sqlite3::Statement::EachBaton>' requested here
EachBaton* baton = stmt->Bind<EachBaton>(info, 0, last);
^
../src/statement.cc:243:142: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
...|| OtherInstanceOf(info[start].As<Object>(), "RegExp") || OtherInstanceOf(info[start].As<Object>(), "Date") || info[start].I...
^
27 warnings generated.
SOLINK_MODULE(target) Release/node_sqlite3.node
COPY /Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/napi-v3-darwin-x64/node_sqlite3.node
TOUCH Release/obj.target/action_after_build.stamp
npm WARN saveError ENOENT: no such file or directory, open '/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/package.json'
npm WARN capstone-project-1-x-press-publishing No description
npm WARN capstone-project-1-x-press-publishing No repository field.
npm WARN capstone-project-1-x-press-publishing No README data
npm WARN capstone-project-1-x-press-publishing No license field.
+ sqlite3@5.0.0
added 113 packages from 137 contributors and audited 211 packages in 42.782s
但最终安装了我认为是后备版本。
目前项目代码似乎正在运行(运行 js 文件最终按预期创建了 sqlite3 数据库文件),所以目前看来它正在运行。
不确定上面显示的安装中的错误和消息是什么意思,以及我是否会遇到更多问题,但现在......让我们看看。
谢谢。
努诺