插件在Babel编译es6的Mac上面安装不了
songdeair:nodejs插件 songminglang$ npm install @babel/preset-env@7.11.0 --save-dev
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/@babel%2fpreset-env failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/songminglang/.npm/_logs/2024-01-22T02_37_20_414Z-debug-0.log
songdeair:nodejs插件 songminglang$ npm install @babel/preset-env@7.11.0 --save-dev
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/@babel%2fpreset-env failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/songminglang/.npm/_logs/2024-01-22T02_40_33_914Z-debug-0.log
songdeair:nodejs插件 songminglang$ npm install @babel/preset-env --save-dev
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/@babel%2fpreset-env failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/songminglang/.npm/_logs/2024-01-22T02_42_46_523Z-debug-0.log
songdeair:nodejs插件 songminglang$
正在回答 回答被采纳积分+1
同学你好,解答如下:
1、将路径nodejs插件中文改为英文目录;
2、针对https协议过期尝试执行npm config set strict-ssl false之后在进行安装babel;
3、不使用淘宝镜像,直接将淘宝镜像切回npm源头:npm config set registry=http://registry.npmjs.org 然后在进行安装babel;
4、如以上没办法解决问题,那么同学需要将node版本降下来最好是与老师的版本号一致node 12 - 14 版本后在进行安装bable。
祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星