# 更改本地项目的版本号 # 参数 patch 代表补丁,版本号的最后一位自动加1 # 参数 minor 代表小修小改,版本号的第二位自动加1 # 参数 major 代表大改,版本号的第一位自动加1 $ npm version patch v0.0.2
# 更改NPM仓库中项目的版本号 $ npm publish
# 查看项目在NPM仓库中的所有版本号 [ '0.0.1', '0.0.2' ]
错误处理:no_perms Private mode enable, only admin can publish this module
1 2 3 4 5 6 7 8 9 10
# 详细的错误信息 npm ERR! publish Failed PUT 403 npm ERR! code E403 npm ERR! no_perms Private mode enable, only admin can publish this module
# 错误原因分析 使用的是淘宝源cnpm,登陆到的是cnpm
# 解决方法 切换到npm的官方源,可执行命令:npm config set registry http://registry.npmjs.org/
错误处理:You do not have permission to publish “npmtest”. Are you logged in as the correct user?
1 2 3 4 5 6 7 8 9 10
# 详细的错误信息 npm ERR! publish Failed PUT 403 npm ERR! code E403 npm ERR! You do not have permission to publish "npmtest". Are you logged in as the correct user? :
错误处理:You cannot publish over the previously published versions: 0.0.3
1 2 3 4 5 6 7 8 9 10
# 详细的错误信息 npm ERR! publish Failed PUT 403 npm ERR! code E403 npm ERR! You cannot publish over the previously published versions: 0.0.3. : hexo-google-adsense