gpt4 book ai didi

npm 发布错误 "toString()"失败

转载 作者:行者123 更新时间:2023-12-04 14:06:04 25 4
gpt4 key购买 nike

我在使用 npm 发布包时遇到问题。这是项目的链接:https://github.com/alexbrillant/react-native-deck-swiper

我收到以下错误日志:

  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 ]

最佳答案

如我所见,这里报告了同样的错误:https://github.com/npm/npm/issues/9552

Some searching indicates that "toString failed" is the error message that results when the string you're trying to serialize is too big for Node's Buffer code to serialize (i.e. it's over 256MiB).

如果你的包中有巨大的东西,尝试将它添加到 .npmignore 文件并再次尝试推送。

在您的具体情况下,我会首先将“示例”文件夹添加到 .npmignore 文件中,然后再次尝试推送。我认为您的包裹的消费者不需要这个。

如果有人正在寻找示例,您可以引导他们到 github 或您的主页。

关于npm 发布错误 "toString()"失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48449688/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com