harmonyos】DevEco Studio IDE安装问题-npm registry access错误

背景:初学者下载安装环境

在开发环境诊断中:

npm registry access错误

表现1:新建项目打开,报错:

Installing pnpm@7.30.0... ]0;

npm ]0;npm prefix ]0;npm ]0;

npm install npm npm ERR! code CERT_HAS_EXPIRED npm ERR! errno CERT_HAS_EXPIRED

npm ERR! request to https://registry.npm.taobao.org/pnpm failed, reason: certifi cate has expired npm ERR! A complete log of this run can be found in: npm ERR!

C:\Program Files\nodejs\node_cache\_logs\2024-09-07T05_03_36_584Z-d ebug-0.log

表现2:侧边preview打开报错

一开始以为是自己安装的nodejs和鸿蒙安装的nodejs不一样的问题。

原因:其实是npm淘宝镜像过期,命令行改一下就好了。

参考这个文章

【HarmonyOS】【DevEco Studio】ohpm、sdk安装失败该如何解决?_harmonyos sdk 装不起-CSDN博客

修改好后,关掉项目重新打开,就能自动成功安装hivgor

另外:接下来如果还有报类似的错误,如:

\.hvigor\project_caches\ff666037e844ef1a2eb1b07484652137\workspace\node_modules\@ohos\hvigor\bin\hvigor.js

--mode module -p module=entry@default -p product=default -p pageType=page -p compileResInc=true -p previewMode=true -p buildRoot=.preview PreviewBuild --watch > hvigor Update the SDKs by going to Tools > SDK Manager > SDK > HarmonyOS and following the onscreen instructions.

Open SDK Manager

Process finished with exit code -1

可尝试:

1.清理缓存重开应用

2.参考该文章,重新下载sdk,好了之后再清理缓存重启应用

HarmonyOS 鸿蒙编译器运行失败_hvigor update the sdks by going to tools > sdk man-CSDN博客

PS D:\酒店预订\xm-hotel-manager> cd vue PS D:\酒店预订\xm-hotel-manager\vue> npm i npm error code EPERM npm error syscall open npm error path D:\ns\node_cache\_cacache\index-v5\ae\cb\7c962421f0da92fc4dbb8f92fe10d9492fff205c3578e6c892f0e881c0e2 npm error errno -4048 npm error Error: EPERM: operation not permitted, open 'D:\ns\node_cache\_cacache\index-v5\ae\cb\7c962421f0da92fc4dbb8f92fe10d9492fff205c3578e6c892f0e881c0e2' npm error at async open (node:internal/fs/promises:638:25) npm error at async writeFile (node:internal/fs/promises:1212:14) npm error at async Object.insert (D:\ns\node_modules\npm\node_modules\cacache\lib\entry-index.js:134:5) npm error at async CacheEntry.store (D:\ns\node_modules\npm\node_modules\make-fetch-happen\lib\cache\entry.js:308:7) npm error at async fetch (D:\ns\node_modules\npm\node_modules\make-fetch-happen\lib\fetch.js:98:7) npm error at async RegistryFetcher.packument (D:\ns\node_modules\npm\node_modules\pacote\lib\registry.js:90:19) npm error at async RegistryFetcher.manifest (D:\ns\node_modules\npm\node_modules\pacote\lib\registry.js:128:23) npm error at async #fetchManifest (D:\ns\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1202:20) npm error at async #nodeFromEdge (D:\ns\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1040:19) npm error at async #buildDepStep (D:\ns\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:904:11) { npm error errno: -4048, npm error code: 'EPERM', npm error syscall: 'open', npm error path: 'D:\\ns\\node_cache\\_cacache\\index-v5\\ae\\cb\\7c962421f0da92fc4dbb8f92fe10d9492fff205c3578e6c892f0e881c0e2', npm error requiredBy: '.' npm error } npm error npm error The operation was rejected by your operating system. npm error It's possible that the file was already in use (by a text editor or antivirus), npm error or that you lack permissions to access it. npm error npm error If you believe this might be a permissions issue, please double-check the npm error permissions of the file and its containing directories, or try running npm error the command again as root/Administrator. npm error Log files were not written due to an error writing to the directory: D:\ns\node_cache\_logs npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal 在idea中
最新发布
04-03
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值