我正在尝试在Ubuntu following this tutorial上部署一个幽灵博客。当我运行sudo npm install --production时,sqlite3包会出现问题。
npm ERR! sqlite3@2.1.19 install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@2.1.19 install script.
npm ERR! This is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node build.js
npm ERR! You can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.
然后我跑了:
npm install sqlite3 --build-from-source
但是出现了另一个问题:
> sqlite3@2.1.19 install /srv/data_studio/web/journal.gentlenode.com/node_modules/sqlite3
> node build.js
make: Entering directory `/srv/data_studio/web/journal.gentlenode.com/node_modules/sqlite3/build'
ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c
TOUCH Release/obj.target/deps/action_before_build.stamp
CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3071700/sqlite3.o
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c: In function ‘porter_stemmer’:
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127208:41: warning: value computed is not used [-Wunused-value]
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127212:39: warning: value computed is not used [-Wunused-value]
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127225:35: warning: value computed is not used [-Wunused-value]
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127230:39: warning: value computed is not used [-Wunused-value]
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127236:41: warning: value computed is not used [-Wunused-value]
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127241:39: warning: value computed is not used [-Wunused-value]
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127250:38: warning: value computed is not used [-Wunused-value]
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127257:37: warning: value computed is not used [-Wunused-value]
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127300:39: warning: value computed is not used [-Wunused-value]
Release/obj/gen/sqlite-autoconf-3071700/sqlite3.c:127320:34: warning: value computed is not used [-Wunused-value]
之后,我甚至无法重新运行sudo npm install --production。
答案 0 :(得分:1)
运行以下命令:
$ sudo npm install -g node-gyp
$ sudo apt-get install build-essential
$ sudo apt-get install python-software-properties python g++ make
这将安装成功运行所需的东西:
$ npm install sqlite3 --build-from-source
希望有所帮助。