在Linux 环境 运行 node-gyp configure 出错了,在线求助
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Linux 环境 运行 node-gyp configure 出错了,在线求助相关的知识,希望对你有一定的参考价值。
参考技术A gyp info it worked if it ends with okgyp info using node-gyp[@0](/user/0).13.0
gyp info using node[@0](/user/0).10.4 | linux | x64
gyp info spawn python
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/workspace/wwwroot/n_phpip/tsc/tj/node_modules/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/root/.node-gyp/0.10.4/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/root/.node-gyp/0.10.4',
gyp info spawn args '-Dmodule_root_dir=/workspace/wwwroot/n_phpip/tsc/tj/node_modules',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
Traceback (most recent call last):
File "/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py", line 18, in <module>
sys.exit(gyp.script_main())
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 534, in script_main
return main(sys.argv[1:])
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 527, in main
return gyp_main(args)
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 503, in gyp_main
options.circular_check)
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 129, in Load
params['parallel'], params['root_targets'])
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 2692, in Load
variables, includes, depth, check, True)
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 362, in LoadTargetBuildFile
includes, True, check)
File "/usr/local/lib/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 219, in LoadOneBuildFile
None)
File "binding.gyp", line 1
^
SyntaxError: invalid syntax
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:340:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Linux 2.6.32-220.el6.x86_64
gyp ERR! command "node" "/usr/local/bin/node-gyp" "configure"
gyp ERR! cwd /workspace/wwwroot/n_phpip/tsc/tj/node_modules
gyp ERR! node -v v0.10.4
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 参考技术B 没有binding.gyp文件 公司有人提供C的代码,用来做我nodejs的扩展模块 是binding.gyp文件报错了,已解决
node-gyp 中应用gcov来测试代码覆盖率
环境: node/node-gyp本地
工具:gcov lcov genhtml
binding.gyp配置:
"cflags" : ["-fprofile-arcs -ftest-coverage"], "ldflags" : ["-lgcov --coverage"],
用gcc编译后在.o相同文件下生成:
*. gcno
运行程序(.js调用native)后生成:
*.gcda
到此,需要的信息已经准备好。
另外需要:lcov生成info文件时,需要源文件:注意查找路径应该正确。
*.h, *.cc
2. 利用lcov生成代码覆盖率信息文件:
lcov -d . -t "$testname" -o "$resultname" -b . -c // egg. lcov -d . -t test -o test.info -b . -c
3. 利用genhtml生成可读的html文件:
genhtml -o result *.info
到此,所需要的文件就在result文件夹下。常用的是:index.html就可以了。
以上是关于在Linux 环境 运行 node-gyp configure 出错了,在线求助的主要内容,如果未能解决你的问题,请参考以下文章
node-gyp 在安装过程中失败 web3 scrypt@6.0.3 install: `node-gyp rebuild`
运行 yarn install 时如何避免 node-gyp 重建?
使用electron和node-serialport的环境搭建过程
text 解决了!当您拥有python 2.7和Visuall C ++构建环境时,Windows上的Node-gyp错误