oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.15k stars 2.77k forks source link

Sometimes not installing latest semver-compat version #5914

Closed dylang closed 1 year ago

dylang commented 1 year ago

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?

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" - lines-and-columns@1.2.0

Additional information

Bun's request as a curl command ```sh 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`. ```json { "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 ```yaml 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 ```sh 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 "lines-and-columns@1.2.4" 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#lines-and-columns@2.0.3" 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 ```
Electroid commented 1 year ago

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 commented 1 year ago

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

lines-and-columns@1.2.4
node_modules/lines-and-columns
  lines-and-columns@"^1.1.6" from parse-json@5.2.0
  node_modules/parse-json
    parse-json@"^5.2.0" from jest-config@28.1.3
    node_modules/jest-config
      jest-config@"^28.1.3" from @jest/core@28.1.3
      node_modules/@jest/core
        @jest/core@"^28.1.1" from jest@28.1.1
        node_modules/jest
          peer jest@"^28.0.0" from ts-jest@28.0.5
          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

lines-and-columns@1.2.0
node_modules/lines-and-columns
  lines-and-columns@"^1.1.6" from parse-json@5.2.0
  node_modules/parse-json
    parse-json@"^5.2.0" from jest-config@28.1.3
    node_modules/jest-config
      jest-config@"^28.1.3" from jest-cli@28.1.3
      node_modules/jest-cli
        jest-cli@"^28.1.1" from jest@28.1.1
        node_modules/jest
          peer jest@"^28.0.0" from ts-jest@28.0.5
          node_modules/ts-jest
            dev ts-jest@"28.0.5" from the root project
dylang commented 1 year ago

Still happening in 1.0.4.

dylang commented 1 year ago

Still happening in 1.0.5.

dylang commented 1 year ago

Still happening in 1.0.6.

dylang commented 1 year ago

I added a test that shows this issue: #6489

dylang commented 1 year ago

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 commented 1 year ago

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

Screenshot 2023-10-19 at 10 23 40 AM
dylang commented 1 year ago

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