我如何使用&quot npm install ts-node-dev -d&quot在termux中?

发布于 2025-02-01 17:41:08 字数 1206 浏览 4 评论 0原文

npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../acorn/bin/acorn
npm ERR! dest /storage/emulated/0/bot-baiano/node_modules/.bin/acorn
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../acorn/bin/acorn' -> '/storage/emulated/0/bot-baiano/node_modules/.bin/acorn'
npm ERR!  [Error: EACCES: permission denied, symlink '../acorn/bin/acorn' -> '/storage/emulated/0/bot-baiano/node_modules/.bin/acorn'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../acorn/bin/acorn',
npm ERR!   dest: '/storage/emulated/0/bot-baiano/node_modules/.bin/acorn'
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/2022-05-27T14_44_58_844Z-debug-0.log
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../acorn/bin/acorn
npm ERR! dest /storage/emulated/0/bot-baiano/node_modules/.bin/acorn
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../acorn/bin/acorn' -> '/storage/emulated/0/bot-baiano/node_modules/.bin/acorn'
npm ERR!  [Error: EACCES: permission denied, symlink '../acorn/bin/acorn' -> '/storage/emulated/0/bot-baiano/node_modules/.bin/acorn'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../acorn/bin/acorn',
npm ERR!   dest: '/storage/emulated/0/bot-baiano/node_modules/.bin/acorn'
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/2022-05-27T14_44_58_844Z-debug-0.log

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

儭儭莪哋寶赑 2025-02-08 17:41:08

问题是因为您正在尝试在手机存储中安装软件包(/storege/仿真)。您的手机确实可以在那里完全访问。例如,您将无法在那里创建 symlinks 。它在

然后,建议在您的Termux分区($ home/$ prefix)内工作。在那里它有效,我已经测试了相同的命令,我得到了以下结果:

~/git-repo/test $ npm i ts-node-dev -D

added 65 packages, and audited 66 packages in 2s

6 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

有一些解决方法可以使其在〜/存储分区中起作用,但是您可能会遇到其他与访问相关的问题。如果您需要访问Termux之外的文件(例如,某些IDE应用程序),我在另一个非常相似的问题此处

希望它有帮助。

The problem is because you are trying to install packages in your phone storage (/storage/emulated). Your phone does'n have full access there. You wont be able, for instance, to create symlinks there. It's explained at the termux documentation.

Then, it's recommended to work inside your termux partition ($HOME/$PREFIX). There it works, I've tested the same command, and I got the result below:

~/git-repo/test $ npm i ts-node-dev -D

added 65 packages, and audited 66 packages in 2s

6 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

There are some workarounds to make it work in the ~/storage partition, but you'll possibly have other access related issues. If you need to access the files outside the termux (some IDE app, for instance), I explained it in another very similar question here.

Hope it helps.

椵侞 2025-02-08 17:41:08

如果要继续在/storage/仿真中安装- NO-bin-links命令在NPM命令末尾。例如:

npm install ts-node-dev -D --no-bin-links

此代码对我有用

If you want to keep installing in /storage/emulated you can use the --no-bin-links command at the end of your npm command. e.g :

npm install ts-node-dev -D --no-bin-links

This code works for me

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文