3

上周工作正常,所以不知道发生了什么。(对于一些格式的道歉,因为它有很多行日志)

节点版本:v10.15.3

npm 版本:6.4.1

npm publish在我的项目文件夹中执行并收到以下错误:

npm ERR! code E400
npm ERR! failed to stream package from json: repo name with owner has wrong number of components: [github.com company dev-js] (wanted 2, got 3) : @company/dev-js

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/luke/.npm/_logs/2020-01-27T16_00_11_703Z-debug.log

调试日志如下:

18 verbose getPublishConfig { registry: 'https://npm.pkg.github.com/' }
19 silly mapToRegistry name @company/dev-js
20 silly mapToRegistry scope (from package name) @company
21 verbose mapToRegistry no registry URL found in name for scope @company
22 silly mapToRegistry using default registry
23 silly mapToRegistry registry https://npm.pkg.github.com/
24 silly mapToRegistry data { type: 'tag',
24 silly mapToRegistry   registry: true,
24 silly mapToRegistry   where: undefined,
24 silly mapToRegistry   raw: '@company/dev-js',
24 silly mapToRegistry   name: '@company/dev-js',
24 silly mapToRegistry   escapedName: '@company%2fdev-js',
24 silly mapToRegistry   scope: '@company',
24 silly mapToRegistry   rawSpec: '',
24 silly mapToRegistry   saveSpec: null,
24 silly mapToRegistry   fetchSpec: 'latest',
24 silly mapToRegistry   gitRange: undefined,
24 silly mapToRegistry   gitCommittish: undefined,
24 silly mapToRegistry   hosted: undefined }
25 silly mapToRegistry uri https://npm.pkg.github.com/@company%2fdev-js
26 verbose publish registryBase https://npm.pkg.github.com/
27 silly publish uploading /tmp/npm-14124-7d74fb5c/tmp/fromDir-c3e4ff77/package.tgz
28 verbose request uri https://npm.pkg.github.com/@company%2fdev-js
29 verbose request sending authorization for write operation
30 info attempt registry request try #1 at 4:03:50 PM
31 verbose request using bearer token for auth
32 verbose request id 43a1c9b1771b70fc
33 http request PUT https://npm.pkg.github.com/@company%2fdev-js
34 http 400 https://npm.pkg.github.com/@company%2fdev-js
35 verbose headers { 'content-security-policy': 'default-src \'none\';',
35 verbose headers   'content-type': 'application/json; charset=utf-8',
35 verbose headers   server: 'GitHub Registry',
35 verbose headers   'strict-transport-security': 'max-age=31536000;',
35 verbose headers   'x-content-type-options': 'nosniff',
35 verbose headers   'x-frame-options': 'DENY',
35 verbose headers   'x-xss-protection': '1; mode=block',
35 verbose headers   date: 'Mon, 27 Jan 2020 16:03:51 GMT',
35 verbose headers   'content-length': '150',
35 verbose headers   'x-github-request-id': 'BC70:4A22:14B33:AFF19:5E2F09E6' }
36 error publish Failed PUT 400
37 verbose stack Error: failed to stream package from json: repo name with owner has wrong number of components: [github.com company dev-js] (wanted 2, got 3) : @company/dev-js
37 verbose stack     at makeError (/home/luke/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:329:12)
37 verbose stack     at RegClient.<anonymous> (/home/luke/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:317:14)
37 verbose stack     at Request._callback (/home/luke/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:216:14)
37 verbose stack     at Request.self.callback (/home/luke/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/request/request.js:185:22)
37 verbose stack     at Request.emit (events.js:189:13)
37 verbose stack     at Request.<anonymous> (/home/luke/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/request/request.js:1161:10)
37 verbose stack     at Request.emit (events.js:189:13)
37 verbose stack     at IncomingMessage.<anonymous> (/home/luke/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/request/request.js:1083:12)
37 verbose stack     at Object.onceWrapper (events.js:277:13)
37 verbose stack     at IncomingMessage.emit (events.js:194:15)
37 verbose stack     at endReadableNT (_stream_readable.js:1125:12)
37 verbose stack     at process._tickCallback (internal/process/next_tick.js:63:19)
38 verbose statusCode 400
39 verbose pkgid @company/dev-js
40 verbose cwd /var/www/vhosts/test/httpdocs/dev-js
41 verbose Linux 2.6.32-754.22.1.el6.x86_64
42 verbose argv "/home/luke/.nvm/versions/node/v10.15.3/bin/node" "/home/luke/.nvm/versions/node/v10.15.3/bin/npm" "publish"
43 verbose node v10.15.3
44 verbose npm  v6.4.1
45 error code E400
46 error failed to stream package from json: repo name with owner has wrong number of components: [github.com company dev-js] (wanted 2, got 3) : @company/dev-js
47 verbose exit [ 1, true ]

其他需要注意的事项:

npm config get registry返回:https ://npm.pkg.github.com/company

npm logout还有错误:

npm ERR! Unexpected token p in JSON at position 4
npm ERR! 404 page not found
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/luke/.npm/_logs/2020-01-27T16_13_29_526Z-debug.log

任何帮助,将不胜感激!谢谢

4

1 回答 1

3

如果这对任何人有用,我的package.json文件有以下内容:

"repository": {
    "type": "git",
    "url": "git://github.com/github.com/carmendata/core-js.git"
  },

应该是什么时候

"repository": {
    "type": "git",
    "url": "https://github.com/carmendata/core-js.git"
  },
于 2020-01-29T14:58:41.373 回答