node - npm publish发生错误

查看:506
本文介绍了node - npm publish发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

首先,我用npm login成功了,使用npm whoami也能看到结果,然后我也使用npm install -g pubish安装了publish。

进入项目目录,使用用npm publish来发布我的项目,遇到以下问题

下面是我的package.json

{
  "name": "wangEditor",
  "filename": "dist/js/wangEditor.min.js",
  "version": "2.0.14",
  "description": "wangEditor - 基于javascript和css开发的 Web富文本编辑器, 轻量、简洁、易用、开源免费",
  "homepage": "http://wangeditor.github.io/",
  "keywords": ["wangEditor", "富文本编辑器"],
  "maintainers": [
    {
      "name": "wangfupeng1988",
      "web": "http://www.cnblogs.com/wangfupeng1988/default.html?OnlyTitle=1",
      "mail": "wangfupeng1988@163.com"
    }
  ],
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/wangfupeng1988/wangEditor"
    }
  ],
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-contrib-concat": "^0.5.1",
    "grunt-contrib-copy": "^0.8.1",
    "grunt-contrib-cssmin": "^0.12.3",
    "grunt-contrib-jshint": "^0.11.2",
    "grunt-contrib-less": "^1.0.1",
    "grunt-contrib-uglify": "^0.9.1",
    "grunt-contrib-watch": "^0.6.1"
  }
}

下面是输出的日志文件 npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'publish', '.' ]
2 info using npm@3.3.10
3 info using node@v0.12.2
4 verbose publish [ '.' ]
5 silly cache add args [ '.', null ]
6 verbose cache add spec .
7 silly cache add parsed spec { raw: '.',
7 silly cache add   scope: null,
7 silly cache add   name: null,
7 silly cache add   rawSpec: '.',
7 silly cache add   spec: '/Users/baidu/github/wangEditor',
7 silly cache add   type: 'directory' }
8 verbose addLocalDirectory /Users/baidu/.npm/wangEditor/2.0.14/package.tgz not in flight; packing
9 info lifecycle wangEditor@2.0.14~prepublish: wangEditor@2.0.14
10 silly lifecycle wangEditor@2.0.14~prepublish: no script for prepublish, continuing
11 verbose tar pack [ '/Users/baidu/.npm/wangEditor/2.0.14/package.tgz',
11 verbose tar pack   '/Users/baidu/github/wangEditor' ]
12 verbose tarball /Users/baidu/.npm/wangEditor/2.0.14/package.tgz
13 verbose folder /Users/baidu/github/wangEditor
14 verbose addLocalTarball adding from inside cache /Users/baidu/.npm/wangEditor/2.0.14/package.tgz
15 silly cache afterAdd wangEditor@2.0.14
16 verbose afterAdd /Users/baidu/.npm/wangEditor/2.0.14/package/package.json not in flight; writing
17 verbose afterAdd /Users/baidu/.npm/wangEditor/2.0.14/package/package.json written
18 silly publish { name: 'wangEditor',
18 silly publish   filename: 'dist/js/wangEditor.min.js',
18 silly publish   version: '2.0.14',
18 silly publish   description: 'wangEditor - 基于javascript和css开发的 Web富文本编辑器, 轻量、简洁、易用、开源免费',
18 silly publish   homepage: 'http://wangeditor.github.io/',
18 silly publish   keywords: [ 'wangEditor', '富文本编辑器' ],
18 silly publish   maintainers:
18 silly publish    [ { name: 'wangfupeng1988',
18 silly publish        email: 'wangfupeng1988@163.com',
18 silly publish        url: 'http://www.cnblogs.com/wangfupeng1988/default.html?OnlyTitle=1' } ],
18 silly publish   repositories:
18 silly publish    [ { type: 'git',
18 silly publish        url: 'git+https://github.com/wangfupeng1988/wangEditor.git' } ],
18 silly publish   devDependencies:
18 silly publish    { grunt: '^0.4.5',
18 silly publish      'grunt-contrib-concat': '^0.5.1',
18 silly publish      'grunt-contrib-copy': '^0.8.1',
18 silly publish      'grunt-contrib-cssmin': '^0.12.3',
18 silly publish      'grunt-contrib-jshint': '^0.11.2',
18 silly publish      'grunt-contrib-less': '^1.0.1',
18 silly publish      'grunt-contrib-uglify': '^0.9.1',
18 silly publish      'grunt-contrib-watch': '^0.6.1' },
18 silly publish   scripts: { start: 'node server.js' },
18 silly publish   readme: '\n1. 介绍\n===\n\n**wangEditor**——轻量级web富文本编辑器,配置方便,使用简单</b>。支持IE8+浏览器。\n\n* 软件官网:[wangEditor.github.io](http://wangeditor.github.io/)\n* demo演示:[wangEditor.github.io](http://wangeditor.github.io/)\n* 文档:[http://www.kancloud.cn/wangfupeng/wangeditor2/113961](http://www.kancloud.cn/wangfupeng/wangeditor2/113961)\n\n![](http://images2015.cnblogs.com/blog/138012/201509/138012-20150910004209122-1645253022.png)\n\n2. 下载\n===\n\n - 点击 [https://github.com/wangfupeng1988/wangEditor/releases](https://github.com/wangfupeng1988/wangEditor/releases) 下载最新版\n - 使用`git`下载: `git clone https://github.com/wangfupeng1988/wangEditor.git`\n - 使用`bower`下载:`bower install wangEditor` (前提保证电脑已安装了`bower`)\n\n3. 使用\n===\n\n引用`wangEditor.css`、`jquery.js`和`wangEditor.js`之后,即可简单生成富文本编辑器,简单易用。\n```html\n<!DOCTYPE html>\n<html>\n<head>\n    <meta charset="UTF-8">\n    <title>wangEditor</title>\n    <link rel="stylesheet" type="text/css" href="../dist/css/wangEditor.min.css">\n    <style type="text/css">\n        #div1 {\n            width: 100%;\n            height: 500px;\n        }\n    </style>\n</head>\n<body>\n    <div id="div1">\n        <p>请输入内容...</p>\n    </div>\n\n    <script type="text/javascript" src="../dist/js/lib/jquery-1.10.2.min.js"></script>\n    <script type="text/javascript" src="../dist/js/wangEditor.min.js"></script>\n    <script type="text/javascript">\n        $(function () {\n            var editor = new wangEditor(\'div1\');\n            editor.create();\n        });\n    </script>\n</body>\n</html>\n```\n\n更多配置,可参见官网的文档页面:[http://www.kancloud.cn/wangfupeng/wangeditor2/113961](http://www.kancloud.cn/wangfupeng/wangeditor2/113961)\n\n4. 本地运行demo\n===\n\n - 确定本机安装了 `nodejs`,可使用 `node -v` 验证\n - 下载源码、解压,或者 `git clone https://github.com/wangfupeng1988/wangEditor.git` 。**注意,`windows`系统必须下载到`C盘`运行**\n - 进入源码目录,找到 `server.js` 或者 `server-windows.js`,windows系统运行 `node server-windows.js` ,mac、linux系统运行 `node server.js`\n - 打开浏览器访问 `http://localhost:8011/test/index.html`\n\n5. 交流\n===\n交流QQ群:**164999061**\n',
18 silly publish   readmeFilename: 'README.md',
18 silly publish   gitHead: '21a6800c47af0588d88946541d5206a3eebdda6c',
18 silly publish   repository:
18 silly publish    { type: 'git',
18 silly publish      url: 'git+https://github.com/wangfupeng1988/wangEditor.git' },
18 silly publish   bugs: { url: 'https://github.com/wangfupeng1988/wangEditor/issues' },
18 silly publish   _id: 'wangEditor@2.0.14',
18 silly publish   _shasum: 'd0d27ecc4e156aee1f48a2d7e2d2ce1aec2d3e58',
18 silly publish   _from: '.' }
19 verbose getPublishConfig undefined
20 silly mapToRegistry name wangEditor
21 silly mapToRegistry using default registry
22 silly mapToRegistry registry https://registry.npmjs.org/
23 silly mapToRegistry uri https://registry.npmjs.org/wangEditor
24 verbose publish registryBase https://registry.npmjs.org/
25 silly publish uploading /Users/baidu/.npm/wangEditor/2.0.14/package.tgz
26 verbose request uri https://registry.npmjs.org/wangEditor
27 verbose request sending authorization for write operation
28 info attempt registry request try #1 at 13:32:21
29 verbose request using bearer token for auth
30 verbose request id 08b17b448e0213a1
31 http request PUT https://registry.npmjs.org/wangEditor
32 http 400 https://registry.npmjs.org/wangEditor
33 verbose headers { 'content-type': 'application/json',
33 verbose headers   'cache-control': 'max-age=300',
33 verbose headers   'content-length': '54',
33 verbose headers   'accept-ranges': 'bytes',
33 verbose headers   date: 'Sun, 06 Mar 2016 05:32:40 GMT',
33 verbose headers   via: '1.1 varnish',
33 verbose headers   connection: 'keep-alive',
33 verbose headers   'x-served-by': 'cache-itm7423-ITM',
33 verbose headers   'x-cache': 'MISS',
33 verbose headers   'x-cache-hits': '0',
33 verbose headers   'x-timer': 'S1457242342.271291,VS0,VE18214' }
34 verbose request invalidating /Users/baidu/.npm/registry.npmjs.org/wangEditor on PUT
35 error publish Failed PUT 400
36 verbose stack Error: name can no longer contain capital letters : wangEditor
36 verbose stack     at makeError (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12)
36 verbose stack     at CachingRegistryClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:252:14)
36 verbose stack     at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14)
36 verbose stack     at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:198:22)
36 verbose stack     at Request.emit (events.js:110:17)
36 verbose stack     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1082:10)
36 verbose stack     at Request.emit (events.js:129:20)
36 verbose stack     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1009:12)
36 verbose stack     at IncomingMessage.emit (events.js:129:20)
36 verbose stack     at _stream_readable.js:908:16
37 verbose statusCode 400
38 verbose pkgid wangEditor
39 verbose cwd /Users/baidu/github/wangEditor
40 error Darwin 15.2.0
41 error argv "node" "/usr/local/bin/npm" "publish" "."
42 error node v0.12.2
43 error npm  v3.3.10
44 error code E400
45 error name can no longer contain capital letters : wangEditor
46 error If you need help, you may report this error at:
46 error     <https://github.com/npm/npm/issues>
47 verbose exit [ 1, true ]

有会的朋友,请指教一二!

解决方案

can no longer contain capital letters

不是说得很明白了么ㄟ(▔ ,▔)ㄏ

这篇关于node - npm publish发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆