NPM无法发布E400新的软件包版本必须包含{shasum,tarball}

时间:2018-03-10 08:29:21

标签: npm npm-publish

我有这个问题突然间我不能再发布到npm了。

运行npm publish

时出现以下错误
  

NPM无法发布E400新的软件包版本必须与{shasum,tarball}具有对象

我不知道我能做些什么,我在网上找不到任何东西。我确实在不同的Mac上做了一个npm版本的小调,忘记了npm发布。所以我尝试从不同的mac发布。但是,我尝试创建补丁版本,仍然得到相同的错误。任何帮助?我附上了下面的日志。

此文件不存在

/var/folders/b1/qwvr4ldn1_375rkwn7yhyk4m0000gn/T/npm-6060-1b2f34a9/tmp/fromDir-157455b2/package.tgz

但是我不知道如何创建它,我尝试删除标记和提交并再次执行npm version minor。它工作正常,但是当我事后npm publish时,我再次得到同样的错误。

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/9.8.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'publish' ]
2 info using npm@5.6.0
3 info using node@v9.8.0
4 verbose npm-session 009a09b3734b2310
5 verbose publish [ '.' ]
6 info lifecycle html5sortable@0.8.0~prepublish: html5sortable@0.8.0
7 info lifecycle html5sortable@0.8.0~prepare: html5sortable@0.8.0
8 info lifecycle html5sortable@0.8.0~prepublishOnly: html5sortable@0.8.0
9 info lifecycle html5sortable@0.8.0~prepack: html5sortable@0.8.0
10 info lifecycle html5sortable@0.8.0~postpack: html5sortable@0.8.0
11 verbose getPublishConfig undefined
12 silly mapToRegistry name html5sortable
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry data { type: 'tag',
15 silly mapToRegistry   registry: true,
15 silly mapToRegistry   where: undefined,
15 silly mapToRegistry   raw: 'html5sortable',
15 silly mapToRegistry   name: 'html5sortable',
15 silly mapToRegistry   escapedName: 'html5sortable',
15 silly mapToRegistry   scope: undefined,
15 silly mapToRegistry   rawSpec: '',
15 silly mapToRegistry   saveSpec: null,
15 silly mapToRegistry   fetchSpec: 'latest',
15 silly mapToRegistry   gitRange: undefined,
15 silly mapToRegistry   gitCommittish: undefined,
15 silly mapToRegistry   hosted: undefined }
16 silly mapToRegistry uri https://registry.npmjs.org/html5sortable
17 verbose publish registryBase https://registry.npmjs.org/
18 silly publish uploading /var/folders/b1/qwvr4ldn1_375rkwn7yhyk4m0000gn/T/npm-6060-1b2f34a9/tmp/fromDir-157455b2/package.tgz
19 verbose request uri https://registry.npmjs.org/html5sortable
20 verbose request sending authorization for write operation
21 info attempt registry request try #1 at 1:09:12 PM
22 verbose request using bearer token for auth
23 verbose request id gda9f5bf7619f2e
24 http request PUT https://registry.npmjs.org/html5sortable
25 http 400 https://registry.npmjs.org/html5sortable
26 verbose headers { 'content-type': 'application/json',
26 verbose headers   'cache-control': 'max-age=300',
26 verbose headers   'content-length': '86',
26 verbose headers   'accept-ranges': 'bytes',
26 verbose headers   date: 'Sat, 10 Mar 2018 12:09:12 GMT',
26 verbose headers   via: '1.1 varnish',
26 verbose headers   connection: 'keep-alive',
26 verbose headers   'x-served-by': 'cache-hhn1520-HHN',
26 verbose headers   'x-cache': 'MISS',
26 verbose headers   'x-cache-hits': '0',
26 verbose headers   'x-timer': 'S1520683750.327475,VS0,VE1855',
26 verbose headers   vary: 'Accept-Encoding, Accept' }
27 error publish Failed PUT 400
28 verbose stack Error: New package version must have dist with {shasum, tarball}. : html5sortable
28 verbose stack     at makeError (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:314:12)
28 verbose stack     at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:302:14)
28 verbose stack     at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:216:14)
28 verbose stack     at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:186:22)
28 verbose stack     at Request.emit (events.js:180:13)
28 verbose stack     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1163:10)
28 verbose stack     at Request.emit (events.js:180:13)
28 verbose stack     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1085:12)
28 verbose stack     at Object.onceWrapper (events.js:272:13)
28 verbose stack     at IncomingMessage.emit (events.js:185:15)
28 verbose stack     at endReadableNT (_stream_readable.js:1101:12)
28 verbose stack     at process._tickCallback (internal/process/next_tick.js:114:19)
29 verbose statusCode 400
30 verbose pkgid html5sortable
31 verbose cwd /Users/lukasoppermann/Code/html5sortable
32 verbose Darwin 16.7.0
33 verbose argv "/usr/local/Cellar/node/9.8.0/bin/node" "/usr/local/bin/npm" "publish"
34 verbose node v9.8.0
35 verbose npm  v5.6.0
36 error code E400
37 error New package version must have dist with {shasum, tarball}. : html5sortable
38 verbose exit [ 1, true ]

2 个答案:

答案 0 :(得分:0)

我的 "Acquiring locks" - { "Return a lock for a key with valid lease limit" in { locker.obtainLock(lockKeyA, suc => { suc.key shouldEqual "AAA" suc.validUntilInMs should be > System.currentTimeMillis() }, (fmsg, lockInfo) => { fmsg shouldBe "" }) } 中有一个dist字段,它正在弄乱发布过程。所以删除它解决了一切。

答案 1 :(得分:0)

您可以尝试

ng init

其中有package.json字段