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`命令,这是就可以正常发布。
相关推荐
得闲喝茶几秒前
JavaScript在数据处理的应用
开发语言·前端·javascript·经验分享·笔记
会周易的程序员7 分钟前
aiDgeScanner架构与实现
c++·ide·物联网·架构·node.js·aiot
前端那点事25 分钟前
Vue3 script setup 语法糖最全教程!零基础吃透+项目落地+面试满分
前端·vue.js
ConardLi29 分钟前
Harness 实践:让 Agent 全自动制作知识讲解视频
前端·人工智能·后端
努力干饭中1 小时前
Vibe Coding 第二弹:做一个 Canvas K线图
前端·canvas·vibecoding
卷帘依旧1 小时前
Vue 响应式原理:Object.defineProperty vs Proxy 深度对比
前端·vue.js
yqcoder1 小时前
原生 AJAX 揭秘:如何使用 XHR 发起请求
前端·ajax·okhttp
ZC跨境爬虫1 小时前
跟着 MDN 学 HTML day_34:(深入XML 中的 CDATASection 接口)
xml·前端·html·html5·媒体
之歆1 小时前
DAY_20JavaScript 条件语句与循环结构深度学习(二)
前端·javascript
山北雨夜漫步1 小时前
LangGraph
java·前端·算法