npm install报错404
$ vue-cli-service serve --mode dev 'vue-cli-service' 不是内部或外部命令,也不是可运行的程序 或批处理文件。 error command failed with exit code 1.
npm err! code e404
npm err! 404 not found - get https://registry.npmjs.org/@chohotech%2flyoral-component - not found
npm err! 404
npm err! 404 '@chohotech/lyoral-component@0.1.20230706140238' is not in this registry.
npm err! 404 npm err! 404 note that you can also install from a npm err! 404 tarball, folder, http url, or git url.
npm err! a complete log of this run can be found in:
npm err! c:\users\29847\appdata\local\npm-cache\_logs\2023-07-21t05_55_42_586z-debug-0.log
排除网上各种关于镜像的解决办法;
出现错误的原因是,我在npm上的用户名是A,而我的包名是 @B/xxxx。
npm规定包名中,@后是用户名,我这里是B,而我的用户名是A。这就是报错的原因。
解决办法也很简单,修改包名,或者用B的账号publish就可以了。
我是少了一个.npmrc文件;该文件添加到根目录就跑起来了。