node.js - Termux - npm ERR!错误 : EPERM: operation not permitted

标签 node.js npm npm-install node-modules termux

在 Termux (Android) 上运行 npm install 时出现这些错误。有什么解决办法吗?

在 Termux (Android) 上运行 npm install 时出现这些错误。有什么解决办法吗?

$ npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"android","arch":"arm64"})

npm ERR! path ../@babel/parser/bin/babel-parser.js
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall symlink
npm ERR! Error: EPERM: operation not permitted, symlink '../@babel/parser/bin/babel-parser.js' -> '/storage/emulated/0/web/tbcians/node_modules/.bin/parser'
npm ERR!  { [OperationalError: EPERM: operation not permitted, symlink '../@babel/parser/bin/babel-parser.js' -> '/storage/emulated/0/web/tbcians/node_modules/.bin/parser']
npm ERR!   cause:
npm ERR!    { [Error: EPERM: operation not permitted, symlink '../@babel/parser/bin/babel-parser.js' -> '/storage/emulated/0/web/tbcians/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/web/tbcians/node_modules/.bin/parser' },
npm ERR!   stack:
npm ERR!    "Error: EPERM: operation not permitted, symlink '../@babel/parser/bin/babel-parser.js' -> '/storage/emulated/0/web/tbcians/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/web/tbcians/node_modules/.bin/parser' }
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 (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /data/data/com.termux/files/home/.npm/_logs/2019-04-21T09_30_40_780Z-debug.log
$

最佳答案

Android 不允许符号链接(symbolic link)存在于内部共享存储中,只需移动目录 web从您的内部存储到位于数据分区中的 Termux 主目录,将解决您的错误。为此,只需使用命令 mv -r /sdcard/web ~ .请注意,这将移动名为 web 的目录。至 /data/data/com.termux/files/home/web .

关于node.js - Termux - npm ERR!错误 : EPERM: operation not permitted,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55781611/

相关文章:

node.js - 我应该将所有子包保留在 package.json 中的单个版本上吗?

javascript - 如何将函数作为 Node 中的模块添加到现有对象?

node.js - 在 MongoDB 中定义 3 个具有不同关系的模式(多对多,一对多......)

node.js - 使用 Nodejs 的服务帐户在 Google 日历中插入事件

javascript - 使用 nodejs 和 NPM 包括其他库/文件/插件

node.js - 在包安装 Node 上显示许可证

angularjs - Angular 安装

php - 关于带有 Web 套接字的 PHP 与与 Node.js 集成或 Node.JS 中的整个站点的思考

javascript - 当我在 React 应用程序上执行 npm start 时,不断收到 "? Something is already running on port 3000"

windows - 安装 npm 在 Windows 上不起作用