首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >NPM/node-gyp错误

NPM/node-gyp错误
EN

Stack Overflow用户
提问于 2017-10-16 21:11:18
回答 1查看 452关注 0票数 1

我曾尝试为npm安装alsa,但我遇到了反复出现的问题。下面)。所有依赖项都已安装,我正在运行最新的node.js、NPM和node-gyp版本。两个不同的完全更新的raspbian wheezy系统已经试用过了。由于我对npm和nodes没有深入的了解,我希望能得到一些关于潜在问题的线索。

我的第一个想法是路径文件有问题。

在目标方面,我想通过管道将alsa声音发送到流服务器,为此,我需要包含npm的alsa绑定。

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

如有任何帮助,非常感谢!

(一些日志丢失了,因为我不能在这里粘贴那么多,但我主要剪切了所有的pcm.h错误,这是相当长的。

代码语言:javascript
运行
复制
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
EN

回答 1

Stack Overflow用户

发布于 2018-03-27 08:20:39

安装gcc-c++就可以解决这个问题了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46771205

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档