[已解决] npm ERR! code EINVALIDPACKAGENAME Invalid package name "": name cannot start with an underscore;

13 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "srt-to-vtt" "-g"
14 verbose node v14.18.1
15 verbose npm  v6.14.15
16 error code EINVALIDPACKAGENAME
17 error Invalid package name "_@babel_parser@7.15.8@@babel": name cannot start with an underscore; name can only contain URL-friendly characters
18 verbose exit [ 1, true ]

解决方案
打开 cmd 输入 npm update -g 等待更新完成即可

posted @ 2022-03-27 14:40  小能日记  阅读(269)  评论(0编辑  收藏  举报