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`命令,这是就可以正常发布。
相关推荐
摸鱼的春哥几秒前
Agent教程15:认识LangChain(中),状态机思维
前端·javascript·后端
明月_清风6 分钟前
告别遮挡:用 scroll-padding 实现优雅的锚点跳转
前端·javascript
明月_清风9 分钟前
原生 JS 侧边栏缩放:从 DOM 监听到底层优化
前端·javascript
万少9 小时前
HarmonyOS 开发必会 5 种 Builder 详解
前端·harmonyos
橙序员小站11 小时前
Agent Skill 是什么?一文讲透 Agent Skill 的设计与实现
前端·后端
炫饭第一名14 小时前
速通Canvas指北🦮——基础入门篇
前端·javascript·程序员
王晓枫14 小时前
flutter接入三方库运行报错:Error running pod install
前端·flutter
符方昊14 小时前
React 19 对比 React 16 新特性解析
前端·react.js
ssshooter14 小时前
又被 Safari 差异坑了:textContent 拿到的值居然没换行?
前端
曲折14 小时前
Cesium-气象要素PNG色斑图叠加
前端·cesium