当前位置:网站首页>npm 发布问题
npm 发布问题
2022-08-07 09:41:00 【MioeC】
创建组件
1、先创建个目录,如demo
2、创建一个index.js文件,这里就以这个为例说明,即需要发布的npm包
3、初始化,在本目录下,执行npm init
package.json中需要配置 devDependencies 和 dependencies
- devDependencies 代表开发环境;
dependencies代表生成环境,后面对应的为版本号
登录并创建账号
npm login
这里可能会报错
D:\Users\4399-5080\Desktop\dm-vuex>npm login
npm ERR! Unexpected token < in JSON at position 0 while parsing near '<!DOCTYPE HTML PUBLI...'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\4399-5080\AppData\Roaming\npm-cache\_logs\2022-08-05T01_35_12_038Z-debug.log
主要是因为你设置了国内镜像,需要修改为官网的地址
npm config set registry=http://registry.npmjs.org
再改回国内镜像
npm config set registry http://registry.npm.taobao.org
发布
npm publish
边栏推荐
猜你喜欢

redis的原理和源码-基本介绍

YOLOV5学习笔记(六)——优化网络架构

Material Design

New in ABP 6.0.0-rc.1

今天的思考

10 things he learned after teaching most of his life at MIT

2022 TV cup mathematical modeling - online documentation

(笔记整理未完成)【图论】最近公共祖先

openharmony new contribution guide
![[Flash programming of Autosar memory stack Memory Stack 4.Tc397]](/img/69/a562a7803e46bc5fb4607a1b13471b.png)
[Flash programming of Autosar memory stack Memory Stack 4.Tc397]
随机推荐
1324_FreeRTOS queue creation function implementation analysis
LeetCode_54_螺旋矩阵
3D~RPG游戏的制作
进程与线程的区别与联系
opencv图像旋转
What is an SRM system?What is the role? How does the enterprise apply the SRM system?
China's mobile phones continue to innovate, and the full screen goes further, leading mobile phone innovation
Material Design
限制ip 1分钟只可以访问3次数据库
redis的原理和源码-redis的六种数据类型基本介绍:string、hash、list、set、zset、stream
4.2 实现注册与登录模块
你如何看待抖音的中视频伙伴计划的?
thinkphp 6.x 任意文件写入漏洞
【正点原子STM32连载】第六章 新建寄存器版本MDK工程 摘自【正点原子】MiniPro STM32H750 开发指南_V1.1
LeetCode #94.二叉树的中序遍历
What skills does a technical director need?priority?
redis的原理和源码-客户端结构体的介绍和源码解析
【正点原子STM32连载】第七章 认识HAL库 摘自【正点原子】MiniPro STM32H750 开发指南_V1.1
redis的原理和源码-数据持久化方式AOF的介绍和源码解析
【.NET6+Modbus】Modbus TCP协议解析、仿真环境以及基于.NET实现基础通信