通过npm安装Realm时出错:npm ERR!在realm@1.2.0安装脚本'node-pre-gyp install --fallback-to-build'上失败 [英] Error installing Realm via npm: npm ERR! Failed at the realm@1.2.0 install script 'node-pre-gyp install --fallback-to-build'

查看:224
本文介绍了通过npm安装Realm时出错:npm ERR!在realm@1.2.0安装脚本'node-pre-gyp install --fallback-to-build'上失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现其他与其他节点程序包回退到二进制版本有关的其他问题,但对于Realm没有.我已经尝试了其他情况下的一些解决方案,例如:

I've found other issues regarding fallback to binary build for other node packages but none for Realm. I've tried some solutions from other scenarios such as:

删除/home/.node-gyp

安装build-essential/安装libkrb5-dev

从项目根目录和node-gyp中删除node_modules,然后重新进行npm install

removing node_modulesfrom project root and node-gyp and then doing a fresh npm install

但是,当我运行npm install --save realm时,我得到了此错误跟踪:

Yet when I run npm install --save realm I get this error trace:

node-pre-gyp ERR! Tried to download(404): https://static.realm.io/node-pre-gyp/realm-v1.2.0-node-v51-linux-ia32.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for realm@1.2.0 and node@7.5.0 (node-v51 ABI) (falling back to source compile with node-gyp) 
make: Entering directory `/home/..../node_modules/realm/build'
  ACTION binding_gyp_vendored_realm_target_download_realm /home/..../node_modules/realm/vendor/realm-node
Downloading dependency: realm-node 2.4.0
Using cached realm-node from TMPDIR
Skipping the sync download because ENABLE_SYNC is false.
  TOUCH Release/obj.target/vendored-realm.stamp
  TOUCH Release/obj.target/realm-core.stamp
  CXX(target) Release/obj.target/object-store/src/object-store/src/binding_callback_thread_observer.o
g++: error: unrecognized command line option ‘-std=c++14’
make: *** [Release/obj.target/object-store/src/object-store/src/binding_callback_thread_observer.o] Error 1
make: Leaving directory `/home/..../node_modules/realm/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:285:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 4.4.0-75-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/./node_modules/realm/compiled/node-v51_linux_ia32/realm.node" "--module_name=realm" "--module_path=/home/..../node_modules/realm/compiled/node-v51_linux_ia32"
gyp ERR! cwd /home/..../node_modules/realm
gyp ERR! node -v v7.5.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/..../node_modules/realm/compiled/node-v51_linux_ia32/realm.node --module_name=realm --module_path=/home/..../node_modules/realm/compiled/node-v51_linux_ia32' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/..../node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:192:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:890:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 4.4.0-75-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/..../node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/..../node_modules/realm
node-pre-gyp ERR! node -v v7.5.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.34
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/..../node_modules/realm/compiled/node-v51_linux_ia32/realm.node --module_name=realm --module_path=/home/..../node_modules/realm/compiled/node-v51_linux_ia32' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! realm@1.2.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the realm@1.2.0 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the realm package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build

我正在使用7.5.0版的节点和4.5.0版的npm. 我有node-pre-gyp软件包. 这是怎么回事?!

I am using node version 7.5.0 and npm version 4.5.0. I have the node-pre-gyp package. What is going on?!

推荐答案

尝试以下逐步操作

在项目文件夹中安装旧版本

Install the older version in the project folder

npm install --save realm@0.14.3

打开node_modules/realm/package.json并删除以下行:

Open node_modules/realm/package.json and remove this line:

"postlink": "node_modules/realm/scripts/rnpm-postlink.js"

链接

react-native link realm

此处找到了解决方案

The solution was found here

这篇关于通过npm安装Realm时出错:npm ERR!在realm@1.2.0安装脚本'node-pre-gyp install --fallback-to-build'上失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆