首页 > 其他分享 >npm依赖包发布到npmjs.org镜像站

npm依赖包发布到npmjs.org镜像站

时间:2023-05-17 19:25:34浏览次数:30  
标签:npm -- blog details https org npmjs

操作步骤:

1.创建https://www.npmjs.org账号

2.点击npmjs网站个人账号菜单下的add organization按钮, 创建组织(存放镜像用)
3.在终端项目目录下设置组织范围
# npm init --scope=@my-org 对于组织范围的程序包,请替换my-org为您的组织名称
# npm init --scope=@my-username 对于用户范围的软件包,请my-username用您的用户名替换:
4.在项目根目录创建LICENCSE文件,并修改license值为MIT。
5.发布。发布之前需要登录账号
# npm login
# npm publish --access public

 

注意:
package.json
{
"name": "@orgName/包名", //组织名称或个人用户名称,后面为包名
"version": "0.0.1",
"description": "ccc",
"main": "dist/index.js",
"keywords": [

...
],
"files": [
  "dist"
],
"scripts": {
  "build": "webpack --mode=production",
  "build:publish": "webpack --mode=production && npm publish",
  "dev": "webpack --watch --progress --mode=development"
},
"author": "xmplus-xrl",
"license": "MIT",
"devDependencies": {

...
},
"::repository::": { //发布成功后自动生成
  "type": "git",
  "url": "http://gitlab.surveyplus.cn/surveylite/survey-core-next.git"
}
}

 

 

LICENSE文件内容(userName为发布者的npmjs.org账号):
MIT License

Copyright (c) 2023 userName

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

 

参考文档:

https://blog.csdn.net/zhangjing1019/article/details/102896421

https://www.jianshu.com/p/d695b8be52d4

https://blog.csdn.net/example440982/article/details/122100666

https://blog.csdn.net/qq_38427709/article/details/126585711

https://blog.csdn.net/hanchengmei/article/details/119104345

https://blog.csdn.net/qq_42611074/article/details/118303050

https://choosealicense.com/licenses/mit/

标签:npm,--,blog,details,https,org,npmjs
From: https://www.cnblogs.com/liuxu-xrl/p/17409808.html

相关文章

  • 【git】报错解决方案-'This is probably not a problem with npm. There is likely ad
    git-commit报错: 原因:npm缓存造成的解决方案: 删除packpackage-lock.json,删除所有依赖,执行npmcacheclean--forcenpminstall......
  • Short-Term Plasticity Neurons Learning to Learn and Forget
    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布!Proceedingsofthe39thInternationalConferenceonMachineLearning Abstract短期可塑性(STP)是一种将衰退记忆储存在大脑皮层突触中的机制。在计算实践中,STP已经被使用,但主要用于脉冲神经元,尽管理论预测它是某些......
  • npm 工具库 yenv 简介
    "yenv"是一个JavaScript库,它是在Node.js环境中使用的npm包之一。它的目的是从环境变量中加载配置,以便在Node.js应用程序中使用。使用yenv,您可以在不同的环境中配置不同的变量,并根据需要轻松地加载这些变量。这些环境可以是开发、测试、生产等等。它也支持默认值和类型......
  • 包管理工具:pnpm | 京东云技术团队
    作者:京东零售杨秀竹pnpm是什么pnpm(performantnpm)指的是高性能的npm,与npm和yarn一样是一款包管理工具,其根据自身独特的包管理方法解决了npm、yarn内部潜在的安全及性能问题,在多数情况下拥有更快速的安装速度、占用更小的存储空间,结合官网给出的性能测试及项目中的使用表......
  • org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps
    org.apache.ibatis.executor.ExecutorException:AquerywasrunandnoResultMapswerefoundfortheMappedStatement'com.xxxx.mapper.EmployeeMapper.selectBybelongweeknull'. It'slikelythatneitheraResultTypenoraResultMapwasspeci......
  • 索引组织表 Index Organizied Table 索引组织表 Index Organizied Table
     CREATETABLEt1(idINTPRIMARYKEY,cINT)ENGINE=Memory;CREATETABLEt2(idINTPRIMARYKEY,cINT)ENGINE=InnoDB;INSERTINTOt1VALUES(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(0,0);INSERTINTOt2VALUES(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(......
  • org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit
    或者在POM中加入<plugins><plugin><groupId>org.codehaus.mojo</groupId><artifactId>exec-maven-plugin</artifactId><version>1.6.0</version><configuration><......
  • Errors:java: 程序包org.springframework.stereotype不存在(解决方法)
    错误截图错误描述java:程序包org.springframework.stereotype不存在解决更改maven项目运行时的编译方式为maven找到File->Settings->Maven->Runner,进行勾选......
  • pnpm workSpace管理Monorepo
    pnpm的优点pnpm会将包安装到本地,减少二次依赖安装的时间节省磁盘空间,它会把包软链到本地,不需要反复安装可以节省网络带宽更好的依赖处理逻辑Monorepo的优势便于管理多个相互依赖的项目便于团队共享知识库便于多个项目的测试发版和迭代流程减少项目管理的成本Mono......
  • 错问题:--谷粒商城--org.springframework.beans.factory.beancreationexception: error
    做谷粒商城使用人人开源的时候,导入nacos时出现这个问题最后发现是自己在导入时没有把这个版本改掉,最终出现问题,大概原因就是spring的版本和nacos的版本不匹配。<parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent<......