npm - npm 错误!enoent ENOENT:没有这样的文件或目录,chmod
问题描述
当我运行时npm i -g express-generator
,它会出错并显示:
➜ GitHub sudo npm i -g express-generator
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/sorted-object-b497dff3/lib'ck for /usr/local/li
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/commander-898e1b43/typings'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/minimist-cb6858d4/example'
WARN WARNtar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/minimist-cb6858d4/test'
tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/ejs-2de19af3/lib'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/express-generator-2930afea/bin'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/concat-map-200521fc/example'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/concat-map-200521fc/test'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/express-generator-2930afea/templates/css'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/express-generator-2930afea/templates/js'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/express-generator-2930afea/templates/js/routes'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/express-generator-2930afea/templates/views'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/mkdirp-f65a1b18/bin'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/mkdirp-f65a1b18/examples'
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/mkdirp-f65a1b18/test'
npm ERR! path /usr/local/lib/node_modules/express-generator/node_modules/mkdirp/bin/cmd.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/express-generator/node_modules/mkdirp/bin/cmd.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mlgyshan/.npm/_logs/2018-12-14T20_50_52_005Z-debug.log
➜ GitHub
我也尝试运行npm cache clean --force
但仍然收到此错误。
解决方案
我刚刚重新安装了节点并且它工作正常。
推荐阅读
- video - 使用 ffmpeg 检查不完整的视频片段
- javascript - 如何一次打开多个标签 [JavaScript]
- laravel - AlpineJS:如何有条件地向元素添加类?
- docker - 销毁使用 docker-compose --project-name prj_name 创建的所有容器和卷
- javascript - Javascript的正确超时
- c# - 无法解决注册时抛出的异常错误
- javascript - 单击时在 div 中增加数字
- java - 如何水平打印出索引和数组编号?
- c++ - 适用于 Windows 的 Quicktime 7 API - couldNotResolveDataRef
- r - 如果我在 R 中使用 5 k-fold,模型训练多少次?