网站开发流程图解释含义,dz网站地图怎么做,公司概况简介,廊坊网站关键词优化title: npm镜像源证书过期 search: 2024-02-29 文章目录 Failed to check for updates 问题ERR_PNPM_NO_PKG_MANIFESTnpm缓存清除指令权限不足导致删除不了解决方案npm创建基础配资文件 Failed to check for updates 问题
错误描述如上
检查完 node,vue,npm 的版本后都没啥问…
title: npm镜像源证书过期 search: 2024-02-29 文章目录 Failed to check for updates 问题ERR_PNPM_NO_PKG_MANIFESTnpm缓存清除指令权限不足导致删除不了解决方案npm创建基础配资文件 Failed to check for updates 问题
错误描述如上
检查完 node,vue,npm 的版本后都没啥问题尝试更新脚手架
使用指令
#npm脚手架更新
pnpm update -g vue/cli出现问题如下
ERR_PNPM_NO_PKG_MANIFEST
这个是报错类型编号 这个报错是没有找到 package.json 的文件我当时没仔细看就尝试重新安装 pnpm
#pnpm更新安装
npm install pnpm -g出现报错
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/pnpm failed, reason: certificate has expirednpm ERR! Log files were not written due to an error writing to the directory: D:\Nodejavascript\node_cache\_logs
npm ERR! You can rerun the command with --loglevelverbose to see the logs in your terminal在这里已经很明显了报错提示是 #reasoncertificate_has_expired 就是说目前我的镜像网站证书过期了我觉得很牛逼连淘宝自己提供的镜像源网站都不去管管证书的嘛来自我复盘的吐槽
当时认为是不是自己的问题进行 npm 缓存清除操作
npm缓存清除指令
npm cache clean --force出现第二个报错
PS D:\front-end\untitled2 npm cache clean --force
npm WARN using --force Recommended protections disabled.
npm ERR! code EPERM
npm ERR! syscall rmdir
npm ERR! path D:\Nodejavascript\node_cache\_cacache\tmp
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rmdir D:\Nodejavascript\node_cache\_cacache\tmp
npm ERR! errno: -4048,
npm ERR! code: EPERM,
npm ERR! syscall: rmdir,
npm ERR! path: D:\\Nodejavascript\\node_cache\\_cacache\\tmp
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! Its possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.npm ERR! Log files were not written due to an error writing to the directory: D:\Nodejavascript\node_cache\_logs
npm ERR! You can rerun the command with --loglevelverbose to see the logs in your terminal其实这个也说的很清楚ErrorEPERMoperation not permittedrmdir ‘D:\Nodejavascript\node_cache\_cacache\tmp’
就是说没有权限删除这个问题一般有几种解决思路
权限不足导致删除不了解决方案
如果是在C盘的文件遇到权限不足建议移出C盘因为C盘的权限是一个迷很容易出现奇奇怪怪的权限问题如果是在其他盘直接开管理员权限运行就可以了
之后明白可能是证书和权限的问题就打算随便执行一下依赖更新操作检验一下是否可用
#npm依赖更新指令
npm install然后给我直接报错了 #没有package的Json文件报错
PS D:\front-end\untitled2 npm install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\front-end\untitled2/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open D:\front-end\untitled2\package.json
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoentnpm ERR! Log files were not written due to an error writing to the directory: D:\Nodejavascript\node_cache\_logs
npm ERR! You can rerun the command with --loglevelverbose to see the logs in your terminal
Wrote to D:\front-end\untitled2\package.json:npm创建基础配资文件
npm init -y这样就默认创建了一个简单的 package.json 文件
ok! 到此为止就基本上将边角问题解决了后续考虑解决问题是否应该切换一个数据源的问题
#npm检查设置远程仓库指令
npm config get registry得到域名
https://npm.taobao.org去网上搜淘宝那个npm 改名了
https://npmmirror.com/最新的是这个我真的心情复杂。
设置一下全局镜像源配置就行了最后完成目的的指令是
npm config set registryhttps://npmmirror.com/如果出现以下这种错误就是说明镜像源太落后了不匹配
PS D:\front-end\untitled3 npm install
npm ERR! code ETARGET
npm ERR! notarget No matching version found for vue/server-renderer3.4.21.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesnt exist.
npm ERR! A complete log of this run can be found in: D:\Nodejavascript\node_cache\_logs\2024-02-29T04_10_05_694Z-debug-0.log
PS D:\front-end\untitled3 npm config set
npm ERR! code EUSAGE
npm ERR!主要从这几句话可以看出 notarget No matching version found for vue/server-renderer3.4.21
这个是之前我换华为云的镜像服务器之后出现的问题最后实在不行了换回了 https://npmmirror.com/ 这个域名
从此解决 npm 无法使用问题