Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/183.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在linux中安装cordova res和sharp软件包时,sharp安装失败(npm)_Android_Linux_Ionic Framework_Npm_Sharp - Fatal编程技术网

Android 在linux中安装cordova res和sharp软件包时,sharp安装失败(npm)

Android 在linux中安装cordova res和sharp软件包时,sharp安装失败(npm),android,linux,ionic-framework,npm,sharp,Android,Linux,Ionic Framework,Npm,Sharp,我已经在ubuntu 20.04和debian buster中安装了node和npm的最新版本。 我已经在linux中安装了apt的libvips和glib包 /usr/include/vips/vips8:35:10:致命错误:glib object.h:没有这样的文件或目录 #包括 ^~~~~~~~~~~~~~~ 编译终止。 make:**[sharp.target.mk:129:Release/obj.target/sharp/src/common.o]错误1 make:离开目录“/us

我已经在ubuntu 20.04和debian buster中安装了node和npm的最新版本。 我已经在linux中安装了apt的libvips和glib包


/usr/include/vips/vips8:35:10:致命错误:glib object.h:没有这样的文件或目录
#包括
^~~~~~~~~~~~~~~
编译终止。
make:**[sharp.target.mk:129:Release/obj.target/sharp/src/common.o]错误1
make:离开目录“/usr/local/lib/node_modules/cordova res/node_modules/sharp/build”
哎呀!构建错误
哎呀!堆栈错误:`make`失败,退出代码:2
哎呀!堆栈位于ChildProcess.onExit(/usr/local/lib/node_modules/npm/node_modules/node gyp/lib/build.js:194:23)
哎呀!ChildProcess.emit上的堆栈(events.js:198:13)
哎呀!在Process.ChildProcess.\u handle.onexit(internal/child\u Process.js:248:12)处堆栈
哎呀!Linux系统5.4.0-42-lowlatency
哎呀!命令“/usr/bin/node”“/usr/local/lib/node_modules/npm/node_modules/node gyp/bin/node gyp.js”“重建”
哎呀!cwd/usr/local/lib/node_modules/cordova res/node_modules/sharp
哎呀!节点-v10.21.0
哎呀!节点gyp-v5.1.0
哎呀!不好
npm错误!代码失效循环
npm错误!错误1
npm错误!sharp@0.25.4安装:`(节点安装/libvips&&node安装/dll复制&&prebuild安装--runtime=napi)| |(节点gyp重建&&node安装/dll复制)`
npm错误!退出状态1
npm错误!
npm错误!失败sharp@0.25.4安装脚本。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm错误!此运行的完整日志可在以下位置找到:
npm错误/root/.npm/_logs/2020-07-25T14_48_56_334Z-debug.log


如果有人知道,请回答。如何将glib object.h添加到vips目录?

现在可以通过更改所需版本(支持的旧nodejs版本)来修复它。使用nvm,您可以轻松地在版本之间切换,而无需卸载当前版本节点中的许多软件包不支持最新(最新)版本。因此,您必须迁移到旧版本。即使它无法通过package manager(npm)安装预构建。

现在,通过更改所需版本(支持的旧nodejs版本)可以修复它。使用nvm,您可以轻松地在版本之间切换,而无需卸载当前版本节点中的许多软件包不支持最新(最新)版本。因此,您必须迁移到较旧的版本。即使它无法通过package manager(npm)安装预构建

/usr/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directory
 #include <glib-object.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
make: *** [sharp.target.mk:129: Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/usr/local/lib/node_modules/cordova-res/node_modules/sharp/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 5.4.0-42-lowlatency
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/cordova-res/node_modules/sharp
gyp ERR! node -v v10.21.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.25.4 install: `(node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sharp@0.25.4 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!     /root/.npm/_logs/2020-07-25T14_48_56_334Z-debug.log