8

理由はわかりませんが、npm を使用してパッケージをインストールする際に問題が発生しています。私はsqlite3をインストールしようとしましたが、次のようなエラーが発生しました:

    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:~$ 

なぜそれがそのようなものなのか考えてみてください。他のパッケージのインストール時に同じ種類のエラーが表示されます。

「git clone git://github.com/developmentsseed/node-sqlite3.git」のような回避策でそれを行うことができますが、これらのパッケージのインストール中に npm がエラーを出すのはなぜだろうと思っていました。

4

5 に答える 5

7

これは、SQLite3 を強制的にコンパイルすることで修正できます。 npm install sqlite3 --build-from-source

次の依存関係がインストールされていることを確認してください

  1. python-ソフトウェアのプロパティ
  2. パイソン
  3. g++
  4. 作る
  5. ビルド必須

または実行sudo npm install -g node-gyp

そこに詳細情報があります (SQlite3 セクション): http://support.ghost.org/troubleshooting/

于 2015-02-04T21:43:48.313 に答える
0

私もこの問題に直面し、ubuntuリポジトリからダウンロードしてインストールしたノードjsを削除し、公式のノードjsサイトからソースコードをダウンロード し、問題なくsqliteを再度インストールしようとした後にコンパイルしました。ノードとnpmを更新することをお勧めしますバージョンも

于 2015-06-29T09:04:50.813 に答える
0

npm を更新してみてください。最新バージョンでテストしたところ、うまくいきました。

または、次のパッケージのいずれかを試してください。

https://github.com/grumdrig/node-sqlite
https://github.com/orlandov/node-sqlite

于 2012-06-14T20:01:29.590 に答える
0

それは私にとって許可の問題でした。エラーの前に次の行が表示されていました。

gyp WARN EACCES current user ("ubuntu") does not have permission to access the dev dir "/root/.cache/node-gyp/14.15.4"

だから私はそうしchmod -R 777 /rootましたnpm i sqlite3

于 2021-01-25T19:10:26.137 に答える