npm 安装 sqlite3 错误 [英] npm install sqlite3 error

查看:28
本文介绍了npm 安装 sqlite3 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道为什么,但是我在使用 npm 安装任何软件包时遇到了问题.我尝试安装 sqlite3 并给出如下错误:

i am not sure why, but i am having issues while installing any of the packages using npm. i tried to install sqlite3 and it gave error as follows:

    naphstor@ubuntu:~$ sudo npm install sqlite3
    [sudo] password for naphstor: 

    > sqlite3@2.0.15 preinstall /home/naphstor/node_modules/sqlite3
    > node-waf clean || true; node-waf configure build

    Nothing to clean (project not configured)
    Setting srcdir to                        : /home/naphstor/node_modules/sqlite3 
    Setting blddir to                        : /home/naphstor/node_modules/sqlite3/build 
    Checking for program g++ or c++          : /usr/bin/g++ 
    Checking for program cpp                 : /usr/bin/cpp 
    Checking for program ar                  : /usr/bin/ar 
    Checking for program ranlib              : /usr/bin/ranlib 
    Checking for g++                         : ok  
    Checking for node path                   : not found 
    Checking for node prefix                 : ok /usr/local 
    Checking for sqlite3                     : not found 
    Checking for library sqlite3             : not found 
    /home/naphstor/node_modules/sqlite3/wscript:29: error: the configuration failed (see             '/home/naphstor/node_modules/sqlite3/build/config.log')                                            
    npm ERR! error installing sqlite3@2.0.15 Error: sqlite3@2.0.15 preinstall: `node-waf        clean || true; node-waf configure build`
    npm ERR! error installing sqlite3@2.0.15 `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
    npm ERR! error installing sqlite3@2.0.15     at ChildProcess.<anonymous>  (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
    npm ERR! error installing sqlite3@2.0.15     at ChildProcess.emit (events.js:70:17)
    npm ERR! error installing sqlite3@2.0.15     at maybeExit (child_process.js:359:16)
    npm ERR! error installing sqlite3@2.0.15     at Process.onexit               (child_process.js:395:5)
    npm ERR! sqlite3@2.0.15 preinstall: `node-waf clean || true; node-waf configure  build`
    npm ERR! `sh "-c" "node-waf clean || true; node-waf configure build"` failed with 1
    npm ERR! 
    npm ERR! Failed at the sqlite3@2.0.15 preinstall 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-waf clean || true; node-waf configure build
    npm ERR! You can get their info via:
    npm ERR!     npm owner ls sqlite3
    npm ERR! There is likely additional logging output above.
    npm ERR! 
    npm ERR! System Linux 3.0.0-12-generic
    npm ERR! command "node" "/usr/local/bin/npm" "install" "sqlite3"
    npm ERR! cwd /home/naphstor
    npm ERR! node -v v0.5.11-pre
    npm ERR! npm -v 1.0.106
    npm ERR! code ELIFECYCLE
    npm ERR! 
    npm ERR! Additional logging details can be found in:
    npm ERR!     /home/naphstor/npm-debug.log
    npm not ok
    naphstor@ubuntu:~$ 

知道为什么会这样.它在安装任何其他软件包时显示相同类型的错误.

any idea why is it like that. it shows same kind of error in installing any of the other packages.

我可以使用git clone git://github.com/developmentseed/node-sqlite3.git"之类的解决方法来完成,但想知道为什么 npm 在安装任何这些软件包时会出错.

I can do it with a workaround like "git clone git://github.com/developmentseed/node-sqlite3.git" but was wondering why npm gives error while installing any of these packages.

推荐答案

这可以通过强制编译 SQLite3 来解决.npm install sqlite3 --build-from-source

This can be fixed by forcing SQLite3 to compile. npm install sqlite3 --build-from-source

确保您安装了以下依赖项

Make sure you have these following dependencies installed

  1. python-software-properties
  2. 蟒蛇
  3. g++
  4. 制作
  5. 构建必备

或运行 sudo npm install -g node-gyp

您会在那里找到更多信息(SQlite3 部分):http://support.ghost.org/troubleshooting/

You will find more informations there (SQlite3 section): http://support.ghost.org/troubleshooting/

这篇关于npm 安装 sqlite3 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆