node.js - 为什么我无法在我的 mac 上安装 nodemon
问题描述
在我的 Mac 上安装 nodemon 时出现这些错误
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
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! /Users/apple/.npm/_logs/2021-06-13T14_06_45_374Z-debug.log
解决方案
所以,试试
第 1 个。
sudo chown -R YourLaptopName: /usr/local/lib/node_modules
2号。
sudo npm install -g nodemon
3日
nodemon -v
推荐阅读
- r - 闪亮应用的 Dockerfile
- python - 使用 PyQt5 将多个 Python 文件转换为 exe
- java - 本地主机上的服务器 Tomcat v8.0 服务器无法启动 - JSF、CDI、JAVA、TOMCAT、ECLIPSE
- reactjs - 如何测试异步反应 redux 调用
- json - 使用 JQ 对多个 JSON 字段执行相同的操作
- matlab - 加速 MATLAB 代码
- internet-explorer - GetOrgChart 在 IE 中展开节点
- php - 为什么两个搜索的组合不起作用?
- python - 下采样 dask 数据帧 - 可能分层
- common-lisp - 为什么没有用 Common Lisp 编写的 Common Lisp 实现?