Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[FEATURE] Allow satisfies to throw errors

オープン
#418 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, node.js
領域
tooling

調査の方向性

Start with functions/satisfies.js and the referenced error location in classes/range.js. Reproduce the invalid range during npm install using the package.json example, then trace how satisfies handles it. Done means the invalid range is distinguishable from an invalid version and produces the requested range error.

索引モデルが issue の本文から書いたものです。

説明

Enhancement semver:major

What / Why

It would be nice to have satisfies throw an error so that we may see that the range does not satisfy due to an invalid range as opposed to an invalid version. The range error that we'd like to see is here: https://github.com/npm/node-semver/blob/cb1ca1d5480a6c07c12ac31ba5f2071ed530c4ed/classes/range.js#L41

When

  • When verifying engine versions during npm install
  • When adding a dependency to package.json during npm install

Where

  • npm/node-semver

How

Current Behavior

Create an empty project with the following package.json:

{
  "name": "foo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "engines": {
    "node": ">=6.5.0 !15"
  },
  "engineStrict": true
}

Run npm install and you get:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '[email protected]',
npm WARN EBADENGINE   required: { node: '>=6.5.0 !15' },
npm WARN EBADENGINE   current: { node: 'v16.11.1', npm: '8.0.0' }
npm WARN EBADENGINE }

up to date, audited 1 package in 414ms

found 0 vulnerabilities
Expected Behavior

Create an empty project with the following package.json:

{
  "name": "foo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "engines": {
    "node": ">=6.5.0 !15"
  },
  "engineStrict": true
}

Run npm install and ideally get something like:

npm WARN EBADENGINE Invalid SemVer Range: >=6.5.0 !15

up to date, audited 1 package in 414ms

found 0 vulnerabilities

Who

  • n/a

References

  • n/a
主要言語
JavaScript
スター
5.5k
フォーク
622
平均マージ
4日 23時間
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

npm/node-semver のほかの issue

npm/node-semver の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。