- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
哪些版本的 npm 附带哪些版本的 Node ?我找不到这样的列表。
最佳答案
在https://nodejs.org/dist/有index.json它指示 Nodejs 的每个版本以及与其捆绑的 npm 版本。
<小时/>index.json
index.json
数组中的一个对象的摘录如下:
[
{
"version": "v10.6.0", //<--- nodejs version
"date": "2018-07-04",
"files": [
...
],
"npm": "6.1.0", //<--- npm version
"v8": "6.7.288.46",
"uv": "",
"zlib": "1.2.11",
"openssl": "1.1.0h",
"modules": "64",
"lts": false
},
...
]
数组中的每个对象都有一个 version
(即 Nodejs 版本) 和 npm
(即 npm 版本) 键/值对。
考虑使用以下 node.js 脚本从 https://nodejs.org/dist/index.json
端点请求数据。
获取版本.js
const { get } = require('https');
const ENDPOINT = 'https://nodejs.org/dist/index.json';
function requestVersionInfo(url) {
return new Promise((resolve, reject) => {
get(url, response => {
let data = '';
response.on('data', chunk => data += chunk);
response.on('end', () => resolve(data));
}).on('error', error => reject(new Error(error)));
});
}
function extractVersionInfo(json) {
return JSON.parse(json).map(({ version, npm = null }) => {
return {
nodejs: version.replace(/^v/, ''),
npm
};
});
}
(async function logVersionInfo() {
try {
const json = await requestVersionInfo(ENDPOINT);
const versionInfo = extractVersionInfo(json);
console.log(JSON.stringify(versionInfo, null, 2));
} catch ({ message }) {
console.error(message);
}
})();
运行以下命令:
node ./path/to/get-versions.js
将在您的控制台上打印如下内容:
[
{
"nodejs": "14.2.0",
"npm": "6.14.4"
},
{
"nodejs": "14.1.0",
"npm": "6.14.4"
},
{
"nodejs": "14.0.0",
"npm": "6.14.4"
},
{
"nodejs": "13.14.0",
"npm": "6.14.4"
},
...
]
如您所见,它列出了 Nodejs 的每个版本及其相应的 npm 版本。
关于node.js - 哪些版本的 npm 附带了哪些版本的 Node?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51238643/
我正在尝试从数据库获取一些标签并通过 json 编码发送到 ios 应用程序。 但不幸的是我在数组中得到了一些“\” { "error_code": 0, "response_
我有多个关于 JavaFX 的问题。 JavaFX 是否随 JDK 8 提供? JavaFX 是否也需要自己的运行时环境? 我查看了我的计算机(我安装了 JDK 和 JRE),但找不到 JavaFX。
这是个笨蛋 http://plnkr.co/edit/Ll09uMtJEC0HqyGBRPjH?p=preview 正如在 plunker 中看到的,我有一个日期、用户和汽车作为输入字段。我可以选择日
这个问题不太可能对任何 future 的访客有帮助;它只与一个较小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于全世界的互联网受众。如需帮助使此问题更广泛适用,visit the
我正在查看 Protractor 网站并看到 this paragraph值得一提的是,Protractor 开发正在升级到 Jasmien 2.0。 Currently, Jasmine Versi
我在 Maven 存储库中的 jar 附加有“-sources”,例如:junit-4.12-sources.jar。请让我知道我可以采取什么措施来避免这种情况。 最佳答案 这些是您正在使用的库的源文
关闭。这个问题是opinion-based .它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题. 4年前关闭。 Improve t
我是一名优秀的程序员,十分优秀!