起初是正常能跑能运行的前端项目,然后就临时安装了一个包,结果没安装成功,没有进package.json 文件里。然后我就删除 node_modules 文件夹和 package-lock.json 文件,重新安装依赖:npm i 失败,报一大堆警告和错误。
$ npm i
npm warn tar TAR_ENTRY_ERROR ENOSPC: no space left on device, open 'C:\Users\13697\Desktop\testAdmin\vite-project-0818\node_modules\@babel\types\lib\converters\toSequenceExpression.js.map'
npm warn tar TAR_ENTRY_ERROR ENOSPC: no space left on device, write
npm warn tar TAR_ENTRY_ERROR ENOSPC: no space left on device, open 'C:\Users\13697\Desktop\testAdmin\vite-project-0818\node_modules\vue\jsx-runtime\index.d.ts'
npm warn tar TAR_ENTRY_ERROR ENOSPC: no space left on device, write
npm warn tar TAR_ENTRY_ERROR EBADF: bad file descriptor, write
npm warn tar TAR_ENTRY_ERROR EBADF: bad file descriptor, write
npm warn tar TAR_ENTRY_ERROR ENOSPC: no space left on device, write
npm warn tar TAR_ENTRY_ERROR ENOSPC: no space left on device, open 'C:\Users\13697\Desktop\testAdmin\vite-project-0818\node_modules\@babel\types\lib\converters\toStatement.js'
...此处省略类似警告多行
npm warn tar TAR_ENTRY_ERROR ENOENT: no such file or directory, lstat 'C:\Users\13697\Desktop\testAdmin\vite-project-0818\node_modules\echarts\types\src\chart\helper'
npm warn cleanup Failed to remove some directories [
npm warn cleanup [
npm warn cleanup 'C:\\Users\\13697\\Desktop\\testAdmin\\vite-project-0818\\node_modules\\@vueuse',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\13697\Desktop\testAdmin\vite-project-0818\node_modules\@vueuse\shared\node_modules\vue-demi'] {
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\\Users\\13697\\Desktop\\testAdmin\\vite-project-0818\\node_modules\\@vueuse\\shared\\node_modules\\vue-demi'
npm warn cleanup }
npm warn cleanup ],
npm warn cleanup [
npm warn cleanup 'C:\\Users\\13697\\Desktop\\testAdmin\\vite-project-0818\\node_modules',
npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\13697\Desktop\testAdmin\vite-project-0818\node_modules\echarts\types'] {
npm warn cleanup errno: -4048,
npm warn cleanup code: 'EPERM',
npm warn cleanup syscall: 'rmdir',
npm warn cleanup path: 'C:\\Users\\13697\\Desktop\\testAdmin\\vite-project-0818\\node_modules\\echarts\\types'
npm warn cleanup }
npm warn cleanup ]
npm warn cleanup ]
npm error code EBADF
npm error EBADF: bad file descriptor, write
npm error A complete log of this run can be found in: D:\scoop_user_apps\persist\nodejs18\cache\_logs\2024-10-19T06_19_46_945Z-debug-0.log
1.尝试过删除 node_modules 文件夹和 package-lock.json 文件,重新安装依赖,也报类似错
2.尝试过切换 npm 镜像源也失败,目前还原成https://registry.npmmirror.com
3.尝试在命令行中运行 npm cache clean --force
后再重新安装依赖也报类似错
4.切换nodejs版本(18、20、22版本)和重启电脑也报类似错
根据思否 AI Bot 提供的建议,我发现可能就是我电脑硬盘空间不足造成的。刚打开我的电脑一看:硬盘可用空间只有26兆了,标红了。