{
  "name": "qzy-npm-test",
  "version": "1.0.1",
  "description": "npm包开发测试",
  "main": "a.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": "",
  "keywords": [
    "qzy",
    "npm-test"
  ],
  "author": "quanzaiyu",
  "license": "ISC"
}
  • a.js
    function hello(name){
      console.log("hello "+ name);
    }
    exports.hello=hello;​

     

  • 'publish' 不是内部或外部命令,也不是可运行的程序​

     

    运行: npm install publish -g 

  • npm adduser

    npm adduser
    Username: xypcn
    Password:
    Email: (this IS public) 20084040@qq.com
    Logged in as xypcn on https://registry.npm.taobao.org/.
    

    如果 on 后面不是 https://registry.npmjs.org/ ,而是其他的镜像,比如我们大家常见的淘宝镜像:

    http://registry.npm.taobao.org/

    那么您首先替换成原来的,替换成原来执行如下命令:

    npm config set registry https://registry.npmjs.org/

    否则会出现401错误。

加入收藏 取消收藏 微博分享 20 次点击 1 回复
xypcn 09-07 11:30 感谢回复者 1

Failed PUT 403 npm ERR! code E403 npm ERR! You cannot publish over the previously published versions: 0.0.1. : weex-kushow 增加版本号可以解决
添加一条新回复
请尽量让自己的回复能够对别人有帮助
冀ICP备16008655号-3
返回顶端