【问题标题】:unable to install realm on linux for react-native无法在 linux 上为 react-native 安装领域
【发布时间】:2019-05-25 10:31:17
【问题描述】:

无法为 react-native 安装领域。无论我用来安装它的不同命令如何,它总是会给出一些错误。它总是给出一些版本不匹配的错误。 尝试安装时使用 - sudo npm install --save realm --target=7.10.0

Getting following error
> lzma-native@3.0.3 install /home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native
> node-pre-gyp install --fallback-to-build && node node_modules/rimraf/bin.js build

node-pre-gyp ERR! Tried to download(undefined): https://node-pre-gyp.addaleax.org/lzma-native/lzma_native-v3.0.3-node-v51-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for lzma-native@3.0.3 and node@7.10.0 (node-v51 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Tried to download(undefined): https://node-pre-gyp.addaleax.org/lzma-native/lzma_native-v3.0.3-node-v51-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for lzma-native@3.0.3 and node@7.10.0 (node-v51 ABI, glibc) (falling back to source compile with node-gyp) 
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/build'
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/binding-v3.0.3-node-v51-linux-x64/lzma_native.node" "--module_name=lzma_native" "--module_path=/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/binding-v3.0.3-node-v51-linux-x64"
gyp ERR! cwd /home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native
gyp ERR! node -v v7.10.1
gyp ERR! node-gyp -v v3.6.2
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 configure --fallback-to-build --module=/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/binding-v3.0.3-node-v51-linux-x64/lzma_native.node --module_name=lzma_native --module_path=/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/binding-v3.0.3-node-v51-linux-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/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:194:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:899:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Linux 3.13.0-32-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native
node-pre-gyp ERR! node -v v7.10.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
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 configure --fallback-to-build --module=/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/binding-v3.0.3-node-v51-linux-x64/lzma_native.node --module_name=lzma_native --module_path=/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/binding-v3.0.3-node-v51-linux-x64' (1)
gyp ERR! configure error stall: info lifecycle lzma-native@3.0.3~install: Faile
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/build'
gyp ERR! System Linux 3.13.0-32-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/binding-v3.0.3-node-v51-linux-x64/lzma_native.node" "--module_name=lzma_native" "--module_path=/home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native/binding-v3.0.3-node-v51-linux-x64"
gyp ERR! cwd /home/ambujeshtripathi/React-Project/DM/LMSReactNative/node_modules/lzma-native
gyp ERR! node -v v7.10.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN react-native-drawer-layout@1.3.2 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout@1.3.2 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-drawer-layout-polyfill@1.3.2 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-push-notification@3.0.1 requires a peer of react-native@>=0.33 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view@0.0.70 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view@0.0.70 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation@1.0.0-beta.13 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-navigation@1.0.0-beta.13 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view@0.0.69 requires a peer of react@* but none is installed. You must install peer dependencies yourself.
npm WARN react-native-tab-view@0.0.69 requires a peer of react-native@* but none is installed. You must install peer dependencies yourself.
npm WARN react-test-renderer@16.0.0-alpha.12 requires a peer of react@^16.0.0-alpha.12 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lzma-native@3.0.3 install: `node-pre-gyp install --fallback-to-build && node node_modules/rimraf/bin.js build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the lzma-native@3.0.3 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/ambujeshtripathi/.npm/_logs/2017-11-27T05_43_48_055Z-debug.log

【问题讨论】:

标签: react-native realm


【解决方案1】:

我通过输入来解决它:

sudo -s

然后:

sudo npm install --save realm

【讨论】:

    猜你喜欢
    • 2019-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-10
    • 1970-01-01
    • 1970-01-01
    • 2017-05-30
    • 1970-01-01
    相关资源
    最近更新 更多