How to install Maven into my project and getting no command found

编程入门 行业动态 更新时间:2024-10-09 23:21:04

How to install <a href=https://www.elefans.com/category/jswz/34/1769865.html style=Maven into my project and getting no command found"/>

How to install Maven into my project and getting no command found

我尝试使用

npm install maven
在本地安装 Maven,然后在终端中运行它,它显示
mvn command not found
然后我尝试使用
npm install maven -g
全局安装它,我收到一个错误:

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/maven
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/maven'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/maven'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/maven'
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.

我在 macOS 13.2.1.

我用

sudo
运行了命令,看起来它已经安装了,但仍然找不到命令
mvn command not found

回答如下:

一个可能的解决方法是:

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

您可以在this similar question中找到有关此问题的更多信息。

更多推荐

How to install Maven into my project and getting no command found

本文发布于:2024-05-13 14:31:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1759676.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Maven   install   command   project

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!