npm查看全局包/路径【mac】

 

npm root -g

Mac 下默认的全局路径是:
/usr/local/lib/node_modules

Ubuntu 下默认的全局路径是:
/usr/lib/node_modules

npm ls -g
查看安装的所以全局包

npm ls -g --depth 0 | grep packageName
--depth 0 仅查看一级目录

 

微信公号搜索:李大头头。(或扫描二维码)找我来玩。

更多【前端技术群】和【内推职位】 资源等着你。

还不定期在公众号请大家喝奶茶!

想与我聊聊或者有什么问题都可以在公众号找到我。

等你哟~

 

bing@Mac ~ % npm i pnpm@9.4.0 -g npm error code EACCES npm error syscall mkdir npm error path /usr/local/lib/node_modules/pnpm npm error errno -13 npm error Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/pnpm' npm error at async mkdir (node:internal/fs/promises:852:10) npm error at async /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:624:20 npm error at async Promise.allSettled (index 0) npm error at async [reifyPackages] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:325:11) npm error at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:142:5) npm error at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:150:5) npm error at async Npm.exec (/usr/local/lib/node_modules/npm/lib/npm.js:207:9) npm error at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:74:5) { npm error errno: -13, npm error code: 'EACCES', npm error syscall: 'mkdir', npm error path: '/usr/local/lib/node_modules/pnpm' npm error } npm error npm error The operation was rejected by your operating system. npm error It is likely you do not have the permissions to access this file as the current user npm error npm error If you believe this might be a permissions issue, please double-check the npm error permissions of the file and its containing directories, or try running npm error the command again as root/Administrator. npm notice npm notice New major version of npm available! 10.9.2 -> 11.3.0 npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0 npm notice To update run: npm install -g npm@11.3.0 npm notice npm error A complete log of this run can be found in: /Users/bing/.npm/_logs/2025-05-14T00_18_23_974Z-debug-0.log
最新发布
05-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

JessicaLilyAn

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值