name cannot start with an underscore; name can only contain URL-friendly characters

在尝试使用npm安装Node.js插件时遇到了错误,提示包名含有非法字符,具体为命名不能以下划线开头。错误日志指出这可能是因为package-lock.json文件版本过旧。解决方案提到可以尝试将npm安装改为cnpm安装来解决这个问题。
摘要由CSDN通过智能技术生成

nodejs安装插件遇到错误,提示命名问题

npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "_@babel_code-frame@7.14.5@@babel": name cannot start with an underscore; name can only contain URL-friendly characters

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\11034\AppData\Local\npm-cache\_logs\2021-10-08T03_37_06_076Z-debug.log

网上搜索到是因为下划线问题无法安装,然后看到组件库有下划线的插件,随即搜索下划线的插件怎么安装

解决方案npm 安装改成 cnpm安装。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

孤独白鲸

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值