didi / chameleon

🦎 一套代码运行多端,一端所见即多端所见
http://cml.didi.cn/
Apache License 2.0
9.02k stars 692 forks source link

npm i -g chameleon-tool 安装出错 #66

Closed yuanruiji closed 5 years ago

yuanruiji commented 5 years ago

bug描述 描述出现的问题 0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'i', 1 verbose cli '-g', 1 verbose cli 'chameleon-tool' ] 2 info using npm@6.7.0 3 info using node@v11.10.0 4 verbose npm-session ce33391a833ff6d8 5 silly install loadCurrentTree 6 silly install readGlobalPackageData 7 silly fetchPackageMetaData error for chameleon-tool@latest The value "false" is invalid for option "readableHighWaterMark" 8 timing stage:rollbackFailedOptional Completed in 5ms 9 timing stage:runTopLevelLifecycles Completed in 200ms 10 verbose stack TypeError: The value "false" is invalid for option "readableHighWaterMark" 10 verbose stack at getHighWaterMark (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/internal/streams/state.js:15:13) 10 verbose stack at new ReadableState (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:122:24) 10 verbose stack at DestroyableTransform.Readable (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:173:25) 10 verbose stack at DestroyableTransform.Duplex (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_duplex.js:60:12) 10 verbose stack at DestroyableTransform.Transform (/usr/local/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_transform.js:100:10) 10 verbose stack at new DestroyableTransform (/usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/through2/through2.js:6:13) 10 verbose stack at /usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/through2/through2.js:53:12 10 verbose stack at /usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/through2/through2.js:46:12 10 verbose stack at Cache.put (/usr/local/lib/node_modules/npm/node_modules/make-fetch-happen/cache.js:176:21) 10 verbose stack at fetch.then.res (/usr/local/lib/node_modules/npm/node_modules/make-fetch-happen/index.js:352:40) 10 verbose stack at processTicksAndRejections (internal/process/next_tick.js:81:5) 11 verbose cwd /Users/**** 12 verbose Darwin 17.4.0 13 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "-g" "chameleon-tool" 14 verbose node v11.10.0 15 verbose npm v6.7.0 16 error code ERR_INVALID_OPT_VALUE 17 error The value "false" is invalid for option "readableHighWaterMark" 18 verbose exit [ 1, true ]

编译环境信息 npm@6.7.0 node@v11.10.0 电脑操作系统:macOS High Sierra 10.13.3

yuanruiji commented 5 years ago

through2版本2.0.5可修复此问题。 查看了你们git项目中chameleon-tool下的npm-shrinkwrap.json,版本确实指为2.0.5.

但检查完: /usr/local/lib/node_modules/npm/node_modules/mississippi/node_modules/through2/ 发现版本为2.0.3。

beatles-chameleon commented 5 years ago

如果是你说的through这个包有问题,可以先把/usr/local/lib/node_modules/npm/node_modules/mississippi 文件夹下都删除 再安装chameleon-tool试试

yuanruiji commented 5 years ago

删了更报错了。重装了node. version: 11.10.1. 出了下面的提示: WARNING: You are likely using a version of node-tar or npm that is incompatible with this version of Node.js. Please use either the version of npm that is bundled with Node.js, or a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) that is compatible with Node.js 9 and above. npm[44112]: ../src/node_zlib.cc:563:static void node::(anonymous namespace)::ZlibStream::Init(const FunctionCallbackInfo &): Assertion `args.Length() == 7 && "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," " dictionary)"' failed. 1: 0x100062df2 node::Abort() [/usr/local/bin/node] 2: 0x100062d24 node::PrintErrorString(char const, ...) [/usr/local/bin/node] 3: 0x1000dde99 node::(anonymous namespace)::ZlibStream::Init(v8::FunctionCallbackInfo const&) [/usr/local/bin/node] 4: 0x100238617 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/usr/local/bin/node] 5: 0x100237be6 v8::internal::MaybeHandle v8::internal::(anonymous namespace)::HandleApiCallHelper(v8::internal::Isolate, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle, v8::internal::BuiltinArguments) [/usr/local/bin/node] 6: 0x1002372e0 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate) [/usr/local/bin/node] 7: 0x18b3c1c4fc7d [1] 44109 abort sudo npm i -g chameleon-tool

yuanruiji commented 5 years ago

彻底重装node后,安装成功了。