npm publish发布到在线仓库时,提示:Scope not found

当`npm publish`发布时,控制台提示:`Scope not found`,具体错误信息如下:

bash 复制代码
npm notice npm ERR! code E404 npm ERR! 404 Not Found - PUT https://registry.npmjs.org/@xxx%2fxxx - Scope not found npm ERR! 404 npm ERR! 404 '@xxx/xxx@0.0.0' is not in this registry. npm ERR! 404 You should bug the author to publish it (or use the name yourself!) 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\Administrator\AppData\Local\npm-cache\_logs\2021-12-06T14_56_55_018Z-debug.log

这是由于包名是`@xxx/xxx`形式造成的。如果包名是`@`开头,需要到npm官网先创建一个组织。

**具体步骤如下:**

  1. 注册`npm`官网账号,并且进入个人中心

  2. 看到页面左侧菜单栏,点击后面的加号

  1. 进入创建组织页面,输入组织名称。(这里不需要加上`@`符号)

如果组织名称已经存在页面会提示:

  1. 再次执行`npm publish`命令,这是就可以正常发布。
相关推荐
tuokuac15 分钟前
nginx配置前端请求转发到指定的后端ip
前端·tcp/ip·nginx
程序员爱钓鱼18 分钟前
Go语言实战案例-开发一个Markdown转HTML工具
前端·后端·go
万少40 分钟前
鸿蒙创新赛 HarmonyOS 6.0.0(20) 关键特性汇总
前端
专注代码七年1 小时前
NVM 使用指南(Node Version Manager)
npm
还有多远.1 小时前
jsBridge接入流程
前端·javascript·vue.js·react.js
蝶恋舞者1 小时前
web 网页数据传输处理过程
前端
非凡ghost1 小时前
FxSound:提升音频体验,让音乐更动听
前端·学习·音视频·生活·软件需求
吃饭最爱2 小时前
html的基础知识
前端·html
我没想到原来他们都是一堆坏人2 小时前
(未完待续...)如何编写一个用于构建python web项目镜像的dockerfile文件
java·前端·python
前端Hardy2 小时前
HTML&CSS:有趣的漂流瓶
前端·javascript·css