Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes not installing latest semver-compat version #5914

Closed
dylang opened this issue Sep 22, 2023 · 9 comments · Fixed by #6611
Closed

Sometimes not installing latest semver-compat version #5914

dylang opened this issue Sep 22, 2023 · 9 comments · Fixed by #6611
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@dylang
Copy link
Contributor

dylang commented Sep 22, 2023

What version of Bun is running?

1.0.3+25e69c71e70ac8a0a88f9cf15b4057bd7b2a633a (and 1.0.0, 1.0.1, 1.0.2)

What platform is your computer?

Darwin 22.6.0 x86_64 i386

What steps can reproduce the bug?

[install.lockfile]
print = "yarn"
$ bun pm cache rm
$ rm -rf bun.lockb yarn.lock node_modules
$ bun install --verbose --latest

This is happening in a monorepo with many dependencies on different versions of parse-json, which depends on lines-and-columns@^1.1.6.

some of the dependencies that use `parse-json`
   read-pkg-up
   load-json-file
   lerna
   jest
   react-dev-utils
   @lerna/command
   read-pkg
   read-pkg-up
   conventional-changelog

What is the expected behavior?

The newest version compatible with ^1.1.6 is installed, which is 1.2.4.

What do you see instead?

  • 1.2.0 is installed.
  • This is not the latest semver-compatible version.
  • This version is not requested by any other modules.
  • This version is not the cache.
  • This version is marked as deprecated (displaying deprecation notices is a separate discussion).
Request: GET /api/npm/virtual-npm/lines-and-columns
	Authorization: Basic xxxxxxxxxxxxxxxxxxx==
	npm-auth-type: legacy
	Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*
	Connection: keep-alive
	User-Agent: Bun/1.0.3
	Host: artifactory.company.com
	Accept-Encoding: gzip, deflate

(log cut)

>    - "lines-and-columns": "^1.1.6" - [email protected]

Additional information

Bun's request as a curl command
curl -X GET \
  https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns \
  -H 'Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxx==' \
  -H 'npm-auth-type: legacy' \
  -H 'Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' \
  -H 'Connection: keep-alive' \
  -H 'User-Agent: Bun/1.0.3' \
  -H 'Host: artifactory.company.com'
JSON Result from Curl

This is coming from Artifactory. I don't see any problems with the data, and it works fine in yarn@v1 and pnpm.

{
  "name" : "lines-and-columns",
  "dist-tags" : {
    "v11x" : "1.1.11",
    "v12x" : "1.2.4",
    "latest" : "2.0.3"
  },
  "versions" : {
    "2.0.0" : {
      "name" : "lines-and-columns",
      "version" : "2.0.0",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-2.0.0.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "deprecated" : "please 2.0.1 or later",
      "_hasShrinkwrap" : false
    },
    "2.0.1" : {
      "name" : "lines-and-columns",
      "version" : "2.0.1",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-2.0.1.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "_hasShrinkwrap" : false
    },
    "1.1.10" : {
      "name" : "lines-and-columns",
      "version" : "1.1.10",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.10.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cu=="
      },
      "_hasShrinkwrap" : false
    },
    "1.1.11" : {
      "name" : "lines-and-columns",
      "version" : "1.1.11",
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.11.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "_hasShrinkwrap" : false
    },
    "2.0.2" : {
      "name" : "lines-and-columns",
      "version" : "2.0.2",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-2.0.2.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "_hasShrinkwrap" : false
    },
    "2.0.3" : {
      "name" : "lines-and-columns",
      "version" : "2.0.3",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-2.0.3.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "_hasShrinkwrap" : false
    },
    "1.1.2" : {
      "name" : "lines-and-columns",
      "version" : "1.1.2",
      "devDependencies" : {
        "babel" : "^6.5.2",
        "babel-plugin-syntax-class-properties" : "^6.8.0",
        "babel-plugin-transform-class-properties" : "^6.10.2",
        "babel-plugin-transform-es2015-block-scoping" : "^6.10.1",
        "babel-plugin-transform-es2015-classes" : "^6.9.0",
        "babel-plugin-transform-es2015-destructuring" : "^6.9.0",
        "babel-plugin-transform-es2015-modules-commonjs" : "^6.10.3",
        "babel-plugin-transform-es2015-shorthand-properties" : "^6.8.0",
        "babel-plugin-transform-flow-strip-types" : "^6.8.0",
        "babel-plugin-transform-strict-mode" : "^6.8.0",
        "cz-conventional-changelog" : "^1.1.6",
        "flow-bin" : "^0.27.0",
        "mocha" : "^2.5.3",
        "rollup" : "^0.33.0",
        "rollup-plugin-babel" : "^2.6.1",
        "semantic-release" : "^4.3.5"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.2.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      }
    },
    "1.2.1" : {
      "name" : "lines-and-columns",
      "version" : "1.2.1",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.2.1.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "deprecated" : "use 1.2.3 or later",
      "_hasShrinkwrap" : false
    },
    "1.1.3" : {
      "name" : "lines-and-columns",
      "version" : "1.1.3",
      "devDependencies" : {
        "babel" : "^6.5.2",
        "babel-plugin-syntax-class-properties" : "^6.8.0",
        "babel-plugin-transform-class-properties" : "^6.10.2",
        "babel-plugin-transform-es2015-block-scoping" : "^6.10.1",
        "babel-plugin-transform-es2015-classes" : "^6.9.0",
        "babel-plugin-transform-es2015-destructuring" : "^6.9.0",
        "babel-plugin-transform-es2015-modules-commonjs" : "^6.10.3",
        "babel-plugin-transform-es2015-shorthand-properties" : "^6.8.0",
        "babel-plugin-transform-flow-strip-types" : "^6.8.0",
        "babel-plugin-transform-strict-mode" : "^6.8.0",
        "cz-conventional-changelog" : "^1.1.6",
        "flow-bin" : "^0.27.0",
        "mocha" : "^2.5.3",
        "rollup" : "^0.33.0",
        "rollup-plugin-babel" : "^2.6.1",
        "semantic-release" : "^4.3.5"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.3.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      }
    },
    "1.2.2" : {
      "name" : "lines-and-columns",
      "version" : "1.2.2",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.2.2.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "deprecated" : "use 1.2.3 or later",
      "_hasShrinkwrap" : false
    },
    "1.1.4" : {
      "name" : "lines-and-columns",
      "version" : "1.1.4",
      "devDependencies" : {
        "babel" : "^6.5.2",
        "babel-plugin-syntax-class-properties" : "^6.8.0",
        "babel-plugin-transform-class-properties" : "^6.10.2",
        "babel-plugin-transform-es2015-block-scoping" : "^6.10.1",
        "babel-plugin-transform-es2015-classes" : "^6.9.0",
        "babel-plugin-transform-es2015-destructuring" : "^6.9.0",
        "babel-plugin-transform-es2015-modules-commonjs" : "^6.10.3",
        "babel-plugin-transform-es2015-shorthand-properties" : "^6.8.0",
        "babel-plugin-transform-flow-strip-types" : "^6.8.0",
        "babel-plugin-transform-strict-mode" : "^6.8.0",
        "cz-conventional-changelog" : "^1.1.6",
        "flow-bin" : "^0.27.0",
        "mocha" : "^2.5.3",
        "rollup" : "^0.33.0",
        "rollup-plugin-babel" : "^2.6.1",
        "semantic-release" : "^4.3.5"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.4.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      }
    },
    "1.2.3" : {
      "name" : "lines-and-columns",
      "version" : "1.2.3",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.2.3.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "_hasShrinkwrap" : false
    },
    "1.1.5" : {
      "name" : "lines-and-columns",
      "version" : "1.1.5",
      "devDependencies" : {
        "babel" : "^6.5.2",
        "babel-plugin-syntax-class-properties" : "^6.8.0",
        "babel-plugin-transform-class-properties" : "^6.10.2",
        "babel-plugin-transform-es2015-block-scoping" : "^6.10.1",
        "babel-plugin-transform-es2015-classes" : "^6.9.0",
        "babel-plugin-transform-es2015-destructuring" : "^6.9.0",
        "babel-plugin-transform-es2015-modules-commonjs" : "^6.10.3",
        "babel-plugin-transform-es2015-shorthand-properties" : "^6.8.0",
        "babel-plugin-transform-flow-strip-types" : "^6.8.0",
        "babel-plugin-transform-strict-mode" : "^6.8.0",
        "cz-conventional-changelog" : "^1.1.6",
        "flow-bin" : "^0.27.0",
        "mocha" : "^2.5.3",
        "rollup" : "^0.33.0",
        "rollup-plugin-babel" : "^2.6.1",
        "semantic-release" : "^4.3.5"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.5.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      }
    },
    "1.2.4" : {
      "name" : "lines-and-columns",
      "version" : "1.2.4",
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "_hasShrinkwrap" : false
    },
    "1.1.6" : {
      "name" : "lines-and-columns",
      "version" : "1.1.6",
      "devDependencies" : {
        "@types/mocha" : "^2.2.34",
        "@types/node" : "^6.0.52",
        "mocha" : "^3.2.0",
        "semantic-release" : "^6.3.2",
        "ts-node" : "^1.7.2",
        "tslint" : "^4.1.1",
        "typescript" : "^2.1.4"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.6.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      }
    },
    "1.1.7" : {
      "name" : "lines-and-columns",
      "version" : "1.1.7",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.7.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "deprecated" : "please use 1.1.8 or 2.0.1 or later",
      "_hasShrinkwrap" : false
    },
    "1.1.8" : {
      "name" : "lines-and-columns",
      "version" : "1.1.8",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.8.tgz",
        "shasum" : "bcc1795411871b77192d8235a37b37f0c077f279",
        "integrity" : "sha512-cut=="
      },
      "deprecated" : "use 1.1.10 or later",
      "_hasShrinkwrap" : false
    },
    "1.1.9" : {
      "name" : "lines-and-columns",
      "version" : "1.1.9",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.9.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "deprecated" : "use 1.1.10 or later",
      "_hasShrinkwrap" : false
    },
    "1.0.0" : {
      "name" : "lines-and-columns",
      "version" : "1.0.0",
      "engines" : {
        "node" : ">=4.0.0"
      },
      "devDependencies" : {
        "babel" : "^6.1.18",
        "babel-plugin-transform-es2015-destructuring" : "^6.1.18",
        "babel-plugin-transform-es2015-modules-commonjs" : "^6.2.0",
        "babel-plugin-transform-flow-strip-types" : "^6.1.18",
        "babel-plugin-transform-strict-mode" : "^6.2.0",
        "mocha" : "^2.3.4",
        "rollup" : "^0.21.0",
        "rollup-plugin-babel" : "^2.1.0"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.0.0.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      }
    },
    "1.0.1" : {
      "name" : "lines-and-columns",
      "version" : "1.0.1",
      "engines" : {
        "node" : ">=4.0.0"
      },
      "devDependencies" : {
        "babel" : "^6.1.18",
        "babel-plugin-transform-es2015-destructuring" : "^6.1.18",
        "babel-plugin-transform-es2015-modules-commonjs" : "^6.2.0",
        "babel-plugin-transform-flow-strip-types" : "^6.1.18",
        "babel-plugin-transform-strict-mode" : "^6.2.0",
        "mocha" : "^2.3.4",
        "rollup" : "^0.21.0",
        "rollup-plugin-babel" : "^2.1.0"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.0.1.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      }
    },
    "1.1.0" : {
      "name" : "lines-and-columns",
      "version" : "1.1.0",
      "devDependencies" : {
        "babel" : "^6.5.2",
        "babel-plugin-syntax-class-properties" : "^6.5.0",
        "babel-plugin-transform-class-properties" : "^6.6.0",
        "babel-plugin-transform-es2015-block-scoping" : "^6.7.0",
        "babel-plugin-transform-es2015-classes" : "^6.6.5",
        "babel-plugin-transform-es2015-destructuring" : "^6.6.5",
        "babel-plugin-transform-es2015-modules-commonjs" : "^6.7.0",
        "babel-plugin-transform-es2015-shorthand-properties" : "^6.5.0",
        "babel-plugin-transform-flow-strip-types" : "^6.7.0",
        "babel-plugin-transform-strict-mode" : "^6.6.5",
        "mocha" : "^2.4.5",
        "rollup" : "^0.25.4",
        "rollup-plugin-babel" : "^2.4.0"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.0.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      }
    },
    "1.0.2" : {
      "name" : "lines-and-columns",
      "version" : "1.0.2",
      "engines" : {
        "node" : ">=4.0.0"
      },
      "devDependencies" : {
        "babel" : "^6.1.18",
        "babel-plugin-transform-es2015-destructuring" : "^6.1.18",
        "babel-plugin-transform-es2015-modules-commonjs" : "^6.2.0",
        "babel-plugin-transform-flow-strip-types" : "^6.1.18",
        "babel-plugin-transform-strict-mode" : "^6.2.0",
        "mocha" : "^2.3.4",
        "rollup" : "^0.21.0",
        "rollup-plugin-babel" : "^2.1.0"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.0.2.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      }
    },
    "1.1.1" : {
      "name" : "lines-and-columns",
      "version" : "1.1.1",
      "devDependencies" : {
        "babel" : "^6.5.2",
        "babel-plugin-syntax-class-properties" : "^6.5.0",
        "babel-plugin-transform-class-properties" : "^6.6.0",
        "babel-plugin-transform-es2015-block-scoping" : "^6.7.0",
        "babel-plugin-transform-es2015-classes" : "^6.6.5",
        "babel-plugin-transform-es2015-destructuring" : "^6.6.5",
        "babel-plugin-transform-es2015-modules-commonjs" : "^6.7.0",
        "babel-plugin-transform-es2015-shorthand-properties" : "^6.5.0",
        "babel-plugin-transform-flow-strip-types" : "^6.7.0",
        "babel-plugin-transform-strict-mode" : "^6.6.5",
        "mocha" : "^2.4.5",
        "rollup" : "^0.25.4",
        "rollup-plugin-babel" : "^2.4.0"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.1.1.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      }
    },
    "1.2.0" : {
      "name" : "lines-and-columns",
      "version" : "1.2.0",
      "engines" : {
        "node" : "^12.20.0 || ^14.13.1 || >=16.0.0"
      },
      "devDependencies" : {
        "@types/jest" : "^27.0.3",
        "@types/node" : "^16.11.9",
        "@typescript-eslint/eslint-plugin" : "^5.4.0",
        "@typescript-eslint/parser" : "^5.4.0",
        "esbuild" : "^0.13.15",
        "esbuild-runner" : "^2.2.1",
        "eslint" : "^8.2.0",
        "eslint-config-prettier" : "^8.3.0",
        "eslint-plugin-prettier" : "^4.0.0",
        "is-ci-cli" : "^2.2.0",
        "jest" : "^27.3.1",
        "prettier" : "^2.4.1",
        "semantic-release" : "^18.0.0",
        "typescript" : "^4.5.2"
      },
      "directories" : { },
      "dist" : {
        "tarball" : "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.2.0.tgz",
        "shasum" : "cut",
        "integrity" : "sha512-cut=="
      },
      "deprecated" : "please use 1.2.1 or later",
      "_hasShrinkwrap" : false
    }
  }
}
bun's generated yarn.lock only has one entry for lines-and-columns
limiter@^1.0.5:
  version "1.1.1"
  resolved "https://artifactory.company.com/api/npm/virtual-npm/limiter/-/limiter-1.1.1.tgz"
  integrity sha512-cut==

lines-and-columns@^1.1.6:
  version "1.2.0"
  resolved "https://artifactory.company.com/api/npm/virtual-npm/lines-and-columns/-/lines-and-columns-1.2.0.tgz"
  integrity sha512-cut==

linkify-urls@^4.1.0:
  version "4.1.0"
  resolved "https://artifactory.company.com/api/npm/virtual-npm/linkify-urls/-/linkify-urls-4.1.0.tgz"
  integrity sha512-cut==
  dependencies:
    create-html-element "^4.0.1"
yarn why lines-and-columns in same monorepo installed with yarn v1
yarn why lines-and-columns
yarn why v1.22.19
[1/4] 🤔  Why do we have the module "lines-and-columns"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "_project_#parse-json" depends on it
   - Hoisted from "_project_#parse-json#lines-and-columns"
info Disk size without dependencies: "24KB"
info Disk size with unique dependencies: "24KB"
info Disk size with transitive dependencies: "24KB"
info Number of shared dependencies: 0
=> Found "nx#[email protected]"
info This module exists because "_project_#lerna#nx" depends on it.
info Disk size without dependencies: "28KB"
info Disk size with unique dependencies: "28KB"
info Disk size with transitive dependencies: "28KB"
info Number of shared dependencies: 0
@dylang dylang added the bug Something isn't working label Sep 22, 2023
@Electroid Electroid added the bun install Something that relates to the npm-compatible client label Sep 22, 2023
@Electroid
Copy link
Contributor

Thanks for all the detail! Indeed it looks like there is a problem with how bun install is picking the latest version or a bug in the semver range code.

@kronodeus
Copy link

kronodeus commented Oct 3, 2023

We are seeing the same issue in our project. It's the only reason we haven't switched over from npm yet!

After npm install:

$ npm install --silent && npm explain lines-and-columns

[email protected]
node_modules/lines-and-columns
  lines-and-columns@"^1.1.6" from [email protected]
  node_modules/parse-json
    parse-json@"^5.2.0" from [email protected]
    node_modules/jest-config
      jest-config@"^28.1.3" from @jest/[email protected]
      node_modules/@jest/core
        @jest/core@"^28.1.1" from [email protected]
        node_modules/jest
          peer jest@"^28.0.0" from [email protected]
          node_modules/ts-jest
            dev ts-jest@"28.0.5" from the root project

After bun install:

$ bun install --silent && npm explain lines-and-columns

[email protected]
node_modules/lines-and-columns
  lines-and-columns@"^1.1.6" from [email protected]
  node_modules/parse-json
    parse-json@"^5.2.0" from [email protected]
    node_modules/jest-config
      jest-config@"^28.1.3" from [email protected]
      node_modules/jest-cli
        jest-cli@"^28.1.1" from [email protected]
        node_modules/jest
          peer jest@"^28.0.0" from [email protected]
          node_modules/ts-jest
            dev ts-jest@"28.0.5" from the root project

@Electroid Electroid changed the title Sometimes not installing latest semver-compat version - lots of detail included Sometimes not installing latest semver-compat version Oct 3, 2023
@dylang
Copy link
Contributor Author

dylang commented Oct 3, 2023

Still happening in 1.0.4.

@dylang
Copy link
Contributor Author

dylang commented Oct 11, 2023

Still happening in 1.0.5.

@dylang
Copy link
Contributor Author

dylang commented Oct 12, 2023

Still happening in 1.0.6.

@dylang
Copy link
Contributor Author

dylang commented Oct 13, 2023

I added a test that shows this issue: #6489

@dylang
Copy link
Contributor Author

dylang commented Oct 18, 2023

I think I found the location of the bug: findBestVersion in npm.zig:

https://github.com/oven-sh/bun/blob/main/src/install/npm.zig#L804-L852

We're not sorting the available versions, we're just returning the first match.

The versions returned by the registry are not necessarily in semver order.

@dylang
Copy link
Contributor Author

dylang commented Oct 20, 2023

I installed Zig and all of the dependencies to try to fix this myself!

Screenshot 2023-10-19 at 10 23 40 AM

@dylang
Copy link
Contributor Author

dylang commented Oct 20, 2023

Fixed! PR incoming!

Only took me a few hours from zero Zig experience to having a fix!

Hardest part was figuring out how to log out the versions.

Screenshot 2023-10-19 at 9 21 06 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants