簡體   English   中英

NPM / node-gyp錯誤

[英]NPM/node-gyp error

我試圖為npm安裝alsa,但遇到了重復的問題(請參閱下面的內容)。 所有依賴項均已安裝,並且我正在運行最新的node.js,NPM和node-gyp版本。 已經嘗試了兩種不同的完全更新的樹莓式微風系統。 因為我對npm和節點沒有足夠的了解,所以我希望從中獲得一些有關潛在問題的線索。

我的第一個想法是路徑文件有問題。

在目標方面,我想將alsa聲音通過管道傳輸到流服務器,因為我需要為npm包括alsa綁定。

https://www.npmjs.com/package/alsa

任何幫助,高度贊賞!

(缺少一些日志,因為我不能在此處粘貼太多,但是我主要剪切了所有pcm.h錯誤,這相當長。

pi@home-automation:~ $ npm install alsa

> alsa@0.0.2 install /home/pi/node_modules/alsa
> node-gyp rebuild

make: Entering directory '/home/pi/node_modules/alsa/build'
  CXX(target) Release/obj.target/alsa/alsa.o
In file included from ../alsa.cc:3:0:
../pcm.h:16:31: error: expected class-name before ‘{’ token
 class Pcm : public ObjectWrap {
                               ^
../pcm.h:48:5: error: ‘uv_work_t’ does not name a type
     uv_work_t request;

########### cutted log here #########

    alsa.target.mk:92: recipe for target 'Release/obj.target/alsa/alsa.o' failed
    make: *** [Release/obj.target/alsa/alsa.o] Error 1
    make: Leaving directory '/home/pi/node_modules/alsa/build'
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
    gyp ERR! stack     at emitTwo (events.js:125:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
    gyp ERR! System Linux 4.9.35-v7+
    gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/pi/node_modules/alsa
    gyp ERR! node -v v8.7.0
    gyp ERR! node-gyp -v v3.6.2
    gyp ERR! not ok 
    npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
    npm WARN pi No description
    npm WARN pi No repository field.
    npm WARN pi No README data
    npm WARN pi No license field.

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! alsa@0.0.2 install: `node-gyp rebuild`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the alsa@0.0.2 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/pi/.npm/_logs/2017-10-16T07_04_32_809Z-debug.log

安裝gcc-c ++,即可解決問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM