npm发布错误“;toString();失败

npm发布错误“;toString();失败,npm,Npm,我在使用npm发布包时遇到问题。 以下是该项目的链接: 我得到以下错误日志: 0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'publish' ] 2 info using npm@5.6.0 3 info using node@v8.9.4 4 verbose npm-session 39bc34a765c36a83 5 v

我在使用npm发布包时遇到问题。 以下是该项目的链接:

我得到以下错误日志:

  0 info it worked if it ends with ok
  1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'publish' ]
  2 info using npm@5.6.0
  3 info using node@v8.9.4
  4 verbose npm-session 39bc34a765c36a83
  5 verbose publish [ '.' ]
  6 info lifecycle react-native-deck-swiper@1.4.7~prepublish: react-native-deck-swiper@1.4.7
  7 info lifecycle react-native-deck-swiper@1.4.7~prepare: react-native-deck-swiper@1.4.7
  8 info lifecycle react-native-deck-swiper@1.4.7~prepublishOnly: react-native-deck-swiper@1.4.7
  9 info lifecycle react-native-deck-swiper@1.4.7~prepack: react-native-deck-swiper@1.4.7
  10 info lifecycle react-native-deck-swiper@1.4.7~postpack: react-native-deck-swiper@1.4.7
  11 verbose getPublishConfig undefined
  12 silly mapToRegistry name react-native-deck-swiper
  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: 'react-native-deck-swiper',
  15 silly mapToRegistry   name: 'react-native-deck-swiper',
  15 silly mapToRegistry   escapedName: 'react-native-deck-swiper',
  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/react-native-deck-swiper
  17 verbose publish registryBase https://registry.npmjs.org/
  18 silly publish uploading /var/folders/db/546t9hvj7yj9fx1s_y5th8mm0000gn/T/npm-5094-27e90b4c/tmp/fromDir-6360d91d/package.tgz
  19 verbose stack Error: "toString()" failed
  19 verbose stack     at stringSlice (buffer.js:578:45)
  19 verbose stack     at Buffer.toString (buffer.js:633:10)
  19 verbose stack     at RegClient.putFirst (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/publish.js:103:23)
  19 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/publish.js:54:14
  19 verbose stack     at ConcatStream.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js:36:43)
  19 verbose stack     at emitNone (events.js:111:20)
  19 verbose stack     at ConcatStream.emit (events.js:208:7)
  19 verbose stack     at finishMaybe (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:607:14)
  19 verbose stack     at endWritable (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:615:3)
  19 verbose stack     at ConcatStream.Writable.end (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_writable.js:571:41)
  19 verbose stack     at ReadStream.onend (_stream_readable.js:595:10)
  19 verbose stack     at Object.onceWrapper (events.js:313:30)
  19 verbose stack     at emitNone (events.js:111:20)
  19 verbose stack     at ReadStream.emit (events.js:208:7)
  19 verbose stack     at endReadableNT (_stream_readable.js:1055:12)
  19 verbose stack     at _combinedTickCallback (internal/process/next_tick.js:138:11)
  20 verbose cwd /Users/alexandre/Documents/react-native/react-native-deck-swiper
  21 verbose Darwin 17.3.0
  22 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "publish"
  23 verbose node v8.9.4
  24 verbose npm  v5.6.0
  25 error "toString()" failed
  26 verbose exit [ 1, true ]
0信息如果它以ok结尾,它就工作了
1详细cli['/usr/local/bin/node','/usr/local/bin/npm','publish']
2信息使用npm@5.6.0
3信息使用node@v8.9.4
4详细的npm会议39bc34a765c36a83
5详细发布['.]
6信息生命周期反应本机甲板-swiper@1.4.7~prepublish:反应本机甲板-swiper@1.4.7
7信息生命周期反应本机甲板-swiper@1.4.7~z~准备:反应-swiper@1.4.7
8信息生命周期反应本机甲板-swiper@1.4.7~prepublishOnly:反应本机甲板-swiper@1.4.7
9信息生命周期反应本机甲板-swiper@1.4.7~prepack:react native deck-swiper@1.4.7
10信息生命周期反应本机甲板-swiper@1.4.7~postpack:react native deck-swiper@1.4.7
11未定义详细的getPublishConfig
12愚蠢的地图注册名称react本机甲板swiper
13使用默认注册表进行地图注册
14地图注册处https://registry.npmjs.org/
15映射注册表数据{type:'tag',
15地图注册处:正确,
15地图注册处:未定义,
15愚蠢的地图注册原始:“反应本机甲板swiper”,
15愚蠢的地图注册名称:“react native deck swiper”,
15愚蠢的MaptoreRegistry escapedName:“react native deck swiper”,
15地图注册范围:未定义,
15愚蠢的地图注册rawSpec:“”,
15映射注册表保存规范:null,
15愚蠢的地图注册获取规范:“最新”,
15地图注册gitRange:未定义,
15愚蠢的地图注册GitCommitteish:未定义,
15地图注册托管:未定义}
16地图注册urihttps://registry.npmjs.org/react-native-deck-swiper
17详细发布注册表库https://registry.npmjs.org/
18/var/folders/db/546t9hvj7yj9fx1s_y5th8mm0000gn/T/npm-5094-27e90b4c/tmp/fromDir-6360d91d/package.tgz
19详细堆栈错误:“toString()”失败
19 stringSlice处的详细堆栈(buffer.js:578:45)
19 Buffer.toString处的详细堆栈(Buffer.js:633:10)
19 RegClient.putFirst上的详细堆栈(/usr/local/lib/node_modules/npm/node_modules/npm registry client/lib/publish.js:103:23)
19详细堆栈位于/usr/local/lib/node_modules/npm/node_modules/npm registry client/lib/publish.js:54:14
19 ConcatStream上的详细堆栈。(/usr/local/lib/node_modules/npm/node_modules/npm registry client/node_modules/concat stream/index.js:36:43)
19 emitNone上的详细堆栈(events.js:111:20)
19 ConcatStream.emit上的详细堆栈(events.js:208:7)
19 finishMaybe的详细堆栈(/usr/local/lib/node_modules/npm/node_modules/readable stream/lib/_stream_writable.js:607:14)
19 endWritable处的详细堆栈(/usr/local/lib/node_modules/npm/node_modules/readable stream/lib/_stream_writable.js:615:3)
19 ConcatStream.Writable.end处的详细堆栈(/usr/local/lib/node_modules/npm/node_modules/readable stream/lib/_stream_Writable.js:571:41)
19 ReadStream.onend处的详细堆栈(_stream_readable.js:595:10)
19 Object.onceWrapper处的详细堆栈(events.js:313:30)
19 emitNone上的详细堆栈(events.js:111:20)
19 ReadStream.emit上的详细堆栈(events.js:208:7)
19 endReadableNT处的详细堆栈(_stream_readable.js:1055:12)
19联合tickCallback处的详细堆栈(内部/process/next_tick.js:138:11)
20个详细cwd/Users/alexandre/Documents/react-native/react-native甲板swiper
21详细达尔文17.3.0
22详细argv“/usr/local/bin/node”“/usr/local/bin/npm”“发布”
23详细节点v8.9.4
24详细的npm v5.6.0
25错误“toString()”失败
26详细退出[1,true]

在我看来,这里报告的错误与此相同:

一些搜索表明“toString失败”是错误消息 当您试图序列化的字符串太大而无法使用时,就会出现这种情况 要序列化的节点缓冲区代码(即超过256MiB)

如果您的包中有很大的内容,请尝试将其添加到.npmignore文件中,然后再次尝试推送

在您的特定情况下,我会首先将“example”文件夹添加到.npmignore文件中,然后再次尝试推送。我认为这不是你们产品包的消费者所需要的

如果有人在找例子,你可以引导他们到github或你的主页