我在vscode上安装babel,总是显示以下错误:
npm error code ENOTFOUND
npm error syscall getaddrinfo
npm error errno ENOTFOUND
npm error network request to http://registry.cnpmjs.org/@babel%2fcore failed, reason: getaddrinfo ENOTFOUND your-proxy-url
npm error network This is a problem related to network connectivity.
npm error network In most cases you are behind a proxy or have bad network settings.
npm error network
npm error network If you are behind a proxy, please make sure that the
npm error network 'proxy' config is set properly. See: 'npm help config'
npm error A complete log of this run can be found in: C:\Users\admin\AppData\Local\npm-cache\_logs\2024-10-09T09_17_38_736Z-debug-0.log
网络没有问题,npm和node.js是已经验证安装成功的,在网上查找资料,尝试过:
cnpm install --save-dev @babel/core和cnpm install --save-dev '@babel/core'
说@可能识别不出来,多次尝试还是失败。
也试过第二种方法:
以管理员身份运行 Windows PowerShell
输入命令 set-ExecutionPolicy RemoteSigned 更改执行策略,接着输入Y
然后输入 get-ExecutionPolicy,查看是否生效,然后 cnpm install --save-dev @babel/core,还是失败。
也试过第三种:
检查dns,刷新,和清理缓存,也试过poershell去执行,全部失败,还有帖子上让去扩展程序上直接下载 Babel javascript,也是不行。
有没有大佬指点指点,我该怎么做,相关的视频我看过没有帮助,代码还是一直执行失败