vue报错 errno -4058 and npm WARN enoent ENOENT

本文介绍了如何解决npm安装过程中遇到的文件缺失错误,并提供了一种有效的方法来更换npm的安装源,以确保开发者能够顺利安装所需的软件包。

1、报错如下:

npm WARN checkPermissions Missing write access to C:\Users\hejinrong\AppData\Roaming\npm\node_modules\vue-cli\node_modules\cliui\node_modules\wordwrap
npm ERR! path C:\Users\liuyg\AppData\Roaming\npm\node_modules\vue-cli\node_modules\cliui\node_modules\wordwrap
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'C:\Users\liuyg\AppData\Roaming\npm\node_modules\vue-cli\node_modules\cliui\node_modules\wordwrap'
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!     C:\Users\liuyg\AppData\Roaming\npm-cache\_logs\2017-10-18T14_34_23_721Z-debug.log


换一个npm安装源就好了,具体方法如下:



2、通过config命令


npm config set registry https://registry.npm.taobao.org


npm info underscore如果上面配置正确这个命令会有字符串response



3、命令行指定


npm --registry https://registry.npm.taobao.org info underscore

然后再安装就好了


第二个错误:

npm WARN enoent ENOENT: no such file or directory, open 'E:\Program Files\nodejs \package.json' npm

 

解决方法:切换到vue项目目录下执行:cnpm run dev即可



npm install idealtree安装失败报错PS E:\vue\Vue3.0> npm install idealtree npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: vite-plugin-inspect@0.8.9 npm WARN Found: vite@7.1.2 npm WARN node_modules/vite npm WARN peer vite@"^5.0.0 || ^6.0.0 || ^7.0.0" from @vitejs/plugin-vue@6.0.1 npm WARN node_modules/@vitejs/plugin-vue npm WARN dev @vitejs/plugin-vue@"^6.0.1" from the root project npm WARN 4 more (vite-hot-client, vite-plugin-vue-devtools, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer vite@"^3.1.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.1" from vite-plugin-inspect@0.8.9 npm WARN node_modules/vite-plugin-vue-devtools/node_modules/vite-plugin-inspect npm WARN vite-plugin-inspect@"0.8.9" from vite-plugin-vue-devtools@7.7.7 npm WARN node_modules/vite-plugin-vue-devtools npm WARN npm WARN Conflicting peer dependency: vite@6.3.5 npm WARN node_modules/vite npm WARN peer vite@"^3.1.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.1" from vite-plugin-inspect@0.8.9 npm WARN node_modules/vite-plugin-vue-devtools/node_modules/vite-plugin-inspect npm WARN vite-plugin-inspect@"0.8.9" from vite-plugin-vue-devtools@7.7.7 npm WARN node_modules/vite-plugin-vue-devtools npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/idealtree - Not found npm ERR! 404 npm ERR! 404 'idealtree@*' is not in this registry. npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: C:\Users\86138\AppData\Local\npm-cache\_logs\2025-08-15T01_09_10_027Z-debug-0.log PS E:\vue\Vue3.0> npm install /path/to/downloaded/package.tgz npm WARN tarball tarball data for file:E:\path\to\downloaded\package.tgz (null) seems to be corrupted. Trying again. npm WARN tarball tarball data for file:E:\path\to\downloaded\package.tgz (null) seems to be corrupted. Trying again. npm ERR! code ENOENT npm ERR! syscall open npm ERR! path E:\path\to\downloaded\package.tgz npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open 'E:\path\to\downloaded\package.tgz' 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: C:\Users\86138\AppData\Local\npm-cache\_logs\2025-08-15T01_09_32_912Z-debug-0.log PS E:\vue\Vue3.0> PS E:\vue\Vue3.0> npm install idealtree npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: vite-plugin-inspect@0.8.9 npm WARN Found: vite@7.1.2 npm WARN node_modules/vite npm WARN peer vite@"^5.0.0 || ^6.0.0 || ^7.0.0" from @vitejs/plugin-vue@6.0.1 npm WARN node_modules/@vitejs/plugin-vue npm WARN dev @vitejs/plugin-vue@"^6.0.1" from the root project npm WARN 4 more (vite-hot-client, vite-plugin-vue-devtools, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer vite@"^3.1.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.1" from vite-plugin-inspect@0.8.9 npm WARN node_modules/vite-plugin-vue-devtools/node_modules/vite-plugin-inspect npm WARN vite-plugin-inspect@"0.8.9" from vite-plugin-vue-devtools@7.7.7 npm WARN node_modules/vite-plugin-vue-devtools npm WARN npm WARN Conflicting peer dependency: vite@6.3.5 npm WARN node_modules/vite npm WARN peer vite@"^3.1.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.1" from vite-plugin-inspect@0.8.9 npm WARN node_modules/vite-plugin-vue-devtools/node_modules/vite-plugin-inspect npm WARN vite-plugin-inspect@"0.8.9" from vite-plugin-vue-devtools@7.7.7 npm WARN node_modules/vite-plugin-vue-devtools npm ERR! code E404 npm ERR! 404 Not Found - GET https://registry.npmjs.org/idealtree - Not found npm ERR! 404 npm ERR! 404 'idealtree@*' is not in this registry. npm ERR! 404 npm ERR! 404 Note that you can also install from a npm ERR! 404 tarball, folder, http url, or git url. npm ERR! A complete log of this run can be found in: C:\Users\86138\AppData\Local\npm-cache\_logs\2025-08-15T01_09_10_027Z-debug-0.log PS E:\vue\Vue3.0> npm install /path/to/downloaded/package.tgz npm WARN tarball tarball data for file:E:\path\to\downloaded\package.tgz (null) seems to be corrupted. Trying again. npm WARN tarball tarball data for file:E:\path\to\downloaded\package.tgz (null) seems to be corrupted. Trying again. npm ERR! code ENOENT npm ERR! syscall open npm ERR! path E:\path\to\downloaded\package.tgz npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open 'E:\path\to\downloaded\package.tgz' 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: C:\Users\86138\AppData\Local\npm-cache\_logs\2025-08-15T01_09_32_912Z-debug-0.log
08-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值