安装本地版本的 postman-to-k6 导致 npm 错误

问题描述

我的情况是,我正在尝试安装 postman-to-k6 以了解如何处理从 postman 到 K6 的转换。我尝试在我的 Ubuntu 机器和 Mac 上安装该软件,但均未成功。

所以我的问题是我是否缺少安装 postman-to-k6 工具的根本步骤,在这种情况下,这会是什么或者 npm 包有什么问题?

我已尝试遵循此处描述的此过程:

https://k6.io/blog/load-testing-with-postman-collections

当我到达使用以下命令的步骤时 npm install -g postman-to-k6 在终端中,此输出显示在 Ubuntu 机器上:

martin.jonsson@unassigned:~$ npm install -g postman-to-k6
loadDep:xml2js → addNameR ▌ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine eslint@7.23.0: wanted: {"node":"^10.12.0 || >=12.0.0"} (current: {"nloadDep:xml2js → addNameR ▀ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine husky@4.3.8: wanted: {"node":">=10"} (current: {"node":"8.10.0","npmnpm WARN deprecated cheerio-select-tmp@0.1.1: Use cheerio-select instead
loadDep:v8-compile-cache  ▀ ╢█████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine chalk@4.1.0: wanted: {"node":">=10"} (current: {"node":"8.10.0","npmloadDep:v8-compile-cache  ▐ ╢█████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine espree@7.3.1: wanted: {"node":"^10.12.0 || >=12.0.0"} (current: {"node":"8.10.0","npm":"3.5.2"})
WARN engine file-entry-cache@6.0.1: wanted: {"node":"^10.12.0 || >=12.0.0"} (current: {"node":"8.10.0","npm":"3.5.2"})
WARN engine table@6.0.9: wanted: {"node":">=10.0.0"} (current: {"node":"8.10.0","npm":"3.5.2"})
WARN engine @eslint/eslintrc@0.4.0: wanted: {"node":"^10.12.0 || >=12.0.0"} (curloadDep:v8-compile-cache  ▐ ╢█████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine semver@7.3.5: wanted: {"node":">=10"} (current: {"node":"8.10.0","nploadDep:v8-compile-cache  ▄ ╢█████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine eslint-visitor-keys@2.0.0: wanted: {"node":">=10"} (current: {"node"loadDep:eslint-visitor-ke ▀ ╢█████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine flat-cache@3.0.4: wanted: {"node":"^10.12.0 || >=12.0.0"} (current: npm ERR! Linux 5.4.0-70-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "postman-to-k6"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror     at andLogAndFinish (/usr/share/npm/lib/fetch-package-Metadata.js:31:3)
npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-Metadata.js:51:22)
npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-Metadata.js:37:12
npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-Metadata.js:82:5)
npm ERR! typeerror     at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-Metadata.js:117:7)
npm ERR! typeerror     at pickVersionFromregistryDocument (/usr/share/npm/lib/fetch-package-Metadata.js:134:20)
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/martin.jonsson/npm-debug.log

解决方法

您正在运行一个非常旧的 NodeJS 版本。日志试图告诉您,您需要运行 10.12.0 和 12.0.0 之间的版本:

tensorflow.contrib.framework.list_variables

虽然我无法在我的机器上重现该错误,但我绝对建议您首先升级到更新版本的 NodeJS。