简体   繁体   English

Termux - npm 错误! 错误:EPERM:不允许操作

[英]Termux - npm ERR! Error: EPERM: operation not permitted

I get these errors when running npm install on Termux (Android).在 Termux (Android) 上运行 npm install 时出现这些错误。 Any solution?有什么解决办法吗?

I get these errors when running npm install on Termux (Android).在 Termux (Android) 上运行 npm install 时出现这些错误。 Any solution?有什么解决办法吗?

$ 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 does not allow symlinks to exist in the Internal Shared storage, simply moving the directory web from your Internal Storage to the Termux home directory which lies in the data partition, will solve your error. Android 不允许符号链接存在于内部共享存储中,只需将目录web从内部存储移动到位于数据分区中的 Termux 主目录,即可解决您的错误。 In order to do this, simply use the command mv -r /sdcard/web ~ .为此,只需使用命令mv -r /sdcard/web ~ Note that this will move your directory named web to /data/data/com.termux/files/home/web .请注意,这会将名为web的目录移动到/data/data/com.termux/files/home/web

或者您可以将整个项目移动到 termux 主目录

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM