【问题标题】:How to run a react native program on android 10 in termux如何在 termux 中的 android 10 上运行 react native 程序
【发布时间】:2021-03-20 09:55:49
【问题描述】:

我想在我的 Android 上进行编程和运行应用程序。所以我正在尝试termux。我有一个在 Ubuntu 上编写的可工作的 react 本机程序。

我打开 termux 导航到程序文件夹并进行了 npm 安装。这是输出:

$ npm install
npm ERR! code EPERM
npm ERR! syscall symlink
npm ERR! path ../@babel/parser/bin/babel-parser.js
npm ERR! dest /storage/emulated/0/lightBag_ExpoVersion2/node_modules/.bin/parser
npm ERR! errno -1
npm ERR! Error: EPERM: operation not permitted, symlink '../@babel/parser/bin/babel-parser.js' -> '/storage/emulated/0/lightBag_ExpoVersion2/node_modules/.bin/parser'
npm ERR!  [Error: EPERM: operation not permitted, symlink '../@babel/parser/bin/babel-parser.js' -> '/storage/emulated/0/lightBag_ExpoVersion2/node_modules/.bin/parser'] {
npm ERR!   errno: -1,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../@babel/parser/bin/babel-parser.js',
npm ERR!   dest: '/storage/emulated/0/lightBag_ExpoVersion2/node_modules/.bin/parser'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2021-03-20T09_47_18_096Z-debug.log

【问题讨论】:

    标签: android react-native npm react-native-android termux


    【解决方案1】:

    我认为是npm install --no-bin-link

    【讨论】:

      【解决方案2】:

      您不能在内部存储中创建符号链接。 你有三个选择: [1] 使用 --no-bin-link 选项。它大部分时间都有效。 [2] 将您的项目移动到 termux 数据文件夹。在这里,termux 拥有更多的权限,如符号链接、chmod 等 [3] root 你的手机并授予 termux 超级用户权限。但这完全是矫枉过正。我不推荐它。

      【讨论】:

        【解决方案3】:

        可能是您有权限问题打开终端并尝试此命令

        sudo npm install -g eslint

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2020-09-24
          • 2019-09-17
          • 1970-01-01
          • 2016-12-04
          相关资源
          最近更新 更多