oven-sh / bun

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

Bun fails to install/add packages to any project that is not on the C: drive #10169

Open Pixeluted opened 7 months ago

Pixeluted commented 7 months ago

What version of Bun is running?

1.1.3+2615dc742

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

  1. Create project on any other drive than C:
  2. Install/add any package
  3. You get the error

What is the expected behavior?

It should install/add the package to my project

What do you see instead?

D:\Projects\BunTest>bun add discord.js
bun add v1.1.3 (2615dc74)
  🔒 Saving lockfile... ???:?:?: 0x7ff6551689d7 in ??? (bun.exe)
???:?:?: 0x7ff65551be9b in ??? (bun.exe)
???:?:?: 0x7ff655314c96 in ??? (bun.exe)
EINVAL: failed to replace old lockfile with new lockfile on disk

Additional information

Tried this on my C: drive and it worked fine.

C:\Users\Pixeluted\Desktop\buntest>bun install discord.js
bun add v1.1.3 (2615dc74)

 installed discord.js@14.14.1

 24 packages installed [394.00ms]
tobycm commented 7 months ago

Can't reproduce. I can install deps just fine on my drive C:/ and D:/

Pixeluted commented 7 months ago

Is your D:/ external or internal?

tobycm commented 7 months ago

image

Disk 0 via SATA, Disk 1 via NVMe. I have a laptop. Both is internal.

thealjey commented 7 months ago

@Pixeluted mine is external and I seem to have the same problem

$ bun install --verbose
bun install v1.1.5 (b257a309)

 [0.00ms] [cache hit] @rescript/core
   - "@rescript/core": "^1.3.0" - @rescript/core@1.3.0

 [0.00ms] [cache hit] rescript
   - "rescript": "^11.1.0" - rescript@11.1.0
warn: CreateHardLinkW failed, falling back to CopyFileW: \\?\C:\Users\me\.bun\install\cache\@rescript\core@1.3.0\CHANGELOG.md - \\?\F:\Projects\res\node_modules\@rescript\core\CHANGELOG.md
  📦 Installing [3/3] Clean lockfile: 3 packages - 3 packages in 43.8us
Blocked 1 scripts for: rescript@11.1.0

-- BEGIN SHA512/256(`${alphabetize(name)}@${order(version)}`) --
@rescript/core@1.3.0
rescript@11.1.0
-- END HASH--
  🔒 Saving lockfile... Saving 1 trees
Saving 2 hoisted_dependencies
Saving 3 resolutions
Saving 3 dependencies
Saving 6 extern_strings
Saving 186 string_bytes
EINVAL: Failed to replace old lockfile with new lockfile on disk
zC4sTr0 commented 6 months ago

I have the same problem. My drive is d:/ and external ssd (by usb)

It works again if I move to C: (internal ssd)

My bun install --verbose ``` PS D:\GIT\Inside Code\gunbound-launcher> bun install --verbose bun install v1.1.10 (5102a944) [5.78ms] migrated lockfile from package-lock.json warn: CreateHardLinkW failed, falling back to CopyFileW: \\?\C:\Users\GABRIEL\.bun\install\cache\semver@6.3.1\range.bnf - \\?\D:\GIT\Inside Code\gunbound-launcher\node_modules\semver\range.bnf 📦 Installing [2/371] Clean lockfile: 371 packages - 371 packages in 922.4us -- BEGIN SHA512/256(`${alphabetize(name)}@${order(version)}`) -- @alloc/quick-lru@5.2.0 @babel/runtime@7.24.6 @eslint-community/eslint-utils@4.4.0 @eslint-community/regexpp@4.10.0 @eslint/eslintrc@2.1.4 @eslint/js@8.57.0 @humanwhocodes/config-array@0.11.14 @humanwhocodes/module-importer@1.0.1 @humanwhocodes/object-schema@2.0.3 @isaacs/cliui@8.0.2 @jridgewell/gen-mapping@0.3.5 @jridgewell/resolve-uri@3.1.2 @jridgewell/set-array@1.2.1 @jridgewell/sourcemap-codec@1.4.15 @jridgewell/trace-mapping@0.3.25 @next/env@14.2.3 @next/eslint-plugin-next@14.2.3 @next/swc-win32-x64-msvc@14.2.3 @nodelib/fs.scandir@2.1.5 @nodelib/fs.stat@2.0.5 @nodelib/fs.walk@1.2.8 @pkgjs/parseargs@0.11.0 @rushstack/eslint-patch@1.10.3 @swc/counter@0.1.3 @swc/helpers@0.5.5 @types/json5@0.0.29 @types/node@20.12.13 @types/prop-types@15.7.12 @types/react@18.3.3 @types/react-dom@18.3.0 @typescript-eslint/parser@7.2.0 @typescript-eslint/scope-manager@7.2.0 @typescript-eslint/types@7.2.0 @typescript-eslint/typescript-estree@7.2.0 @typescript-eslint/visitor-keys@7.2.0 @ungap/structured-clone@1.2.0 acorn@8.11.3 acorn-jsx@5.3.2 ajv@6.12.6 ansi-regex@5.0.1 ansi-regex@5.0.1 ansi-regex@5.0.1 ansi-regex@5.0.1 ansi-regex@6.0.1 ansi-regex@6.0.1 ansi-regex@6.0.1 ansi-styles@4.3.0 ansi-styles@6.2.1 any-promise@1.3.0 anymatch@3.1.3 arg@5.0.2 argparse@2.0.1 aria-query@5.3.0 array-buffer-byte-length@1.0.1 array-includes@3.1.8 array-union@2.1.0 array.prototype.findlast@1.2.5 array.prototype.findlastindex@1.2.5 array.prototype.flat@1.3.2 array.prototype.flatmap@1.3.2 array.prototype.toreversed@1.1.2 array.prototype.tosorted@1.1.3 arraybuffer.prototype.slice@1.0.3 ast-types-flow@0.0.8 available-typed-arrays@1.0.7 axe-core@4.7.0 axobject-query@3.2.1 balanced-match@1.0.2 binary-extensions@2.3.0 brace-expansion@1.1.11 brace-expansion@2.0.1 brace-expansion@2.0.1 brace-expansion@2.0.1 braces@3.0.3 busboy@1.6.0 call-bind@1.0.7 callsites@3.1.0 camelcase-css@2.0.1 caniuse-lite@1.0.30001625 chalk@4.1.2 chokidar@3.6.0 client-only@0.0.1 color-convert@2.0.1 color-name@1.1.4 commander@4.1.1 concat-map@0.0.1 cross-spawn@7.0.3 cssesc@3.0.0 csstype@3.1.3 damerau-levenshtein@1.0.8 data-view-buffer@1.0.1 data-view-byte-length@1.0.1 data-view-byte-offset@1.0.0 debug@3.2.7 debug@3.2.7 debug@3.2.7 debug@4.3.4 deep-is@0.1.4 define-data-property@1.1.4 define-properties@1.2.1 dequal@2.0.3 didyoumean@1.2.2 dir-glob@3.0.1 dlv@1.1.3 doctrine@2.1.0 doctrine@2.1.0 doctrine@3.0.0 eastasianwidth@0.2.0 emoji-regex@8.0.0 emoji-regex@8.0.0 emoji-regex@9.2.2 enhanced-resolve@5.16.1 es-abstract@1.23.3 es-define-property@1.0.0 es-errors@1.3.0 es-iterator-helpers@1.0.19 es-object-atoms@1.0.0 es-set-tostringtag@2.0.3 es-shim-unscopables@1.0.2 es-to-primitive@1.2.1 escape-string-regexp@4.0.0 eslint@8.57.0 eslint-config-next@14.2.3 eslint-import-resolver-node@0.3.9 eslint-import-resolver-typescript@3.6.1 eslint-module-utils@2.8.1 eslint-plugin-import@2.29.1 eslint-plugin-jsx-a11y@6.8.0 eslint-plugin-react@7.34.2 eslint-plugin-react-hooks@4.6.2 eslint-scope@7.2.2 eslint-visitor-keys@3.4.3 espree@9.6.1 esquery@1.5.0 esrecurse@4.3.0 estraverse@5.3.0 esutils@2.0.3 fast-deep-equal@3.1.3 fast-glob@3.3.2 fast-json-stable-stringify@2.1.0 fast-levenshtein@2.0.6 fastq@1.17.1 file-entry-cache@6.0.1 fill-range@7.1.1 find-up@5.0.0 flat-cache@3.2.0 flatted@3.3.1 for-each@0.3.3 foreground-child@3.1.1 fs.realpath@1.0.0 function-bind@1.1.2 function.prototype.name@1.1.6 functions-have-names@1.2.3 get-intrinsic@1.2.4 get-symbol-description@1.0.2 get-tsconfig@4.7.5 glob@7.2.3 glob@10.3.10 glob@10.4.1 glob-parent@5.1.2 glob-parent@5.1.2 glob-parent@6.0.2 globals@13.24.0 globalthis@1.0.4 globby@11.1.0 gopd@1.0.1 graceful-fs@4.2.11 graphemer@1.4.0 has-bigints@1.0.2 has-flag@4.0.0 has-property-descriptors@1.0.2 has-proto@1.0.3 has-symbols@1.0.3 has-tostringtag@1.0.2 hasown@2.0.2 ignore@5.3.1 import-fresh@3.3.0 imurmurhash@0.1.4 inflight@1.0.6 inherits@2.0.4 internal-slot@1.0.7 is-array-buffer@3.0.4 is-async-function@2.0.0 is-bigint@1.0.4 is-binary-path@2.1.0 is-boolean-object@1.1.2 is-callable@1.2.7 is-core-module@2.13.1 is-data-view@1.0.1 is-date-object@1.0.5 is-extglob@2.1.1 is-finalizationregistry@1.0.2 is-fullwidth-code-point@3.0.0 is-generator-function@1.0.10 is-glob@4.0.3 is-map@2.0.3 is-negative-zero@2.0.3 is-number@7.0.0 is-number-object@1.0.7 is-path-inside@3.0.3 is-regex@1.1.4 is-set@2.0.3 is-shared-array-buffer@1.0.3 is-string@1.0.7 is-symbol@1.0.4 is-typed-array@1.1.13 is-weakmap@2.0.2 is-weakref@1.0.2 is-weakset@2.0.3 isarray@2.0.5 isexe@2.0.0 iterator.prototype@1.1.2 jackspeak@2.3.6 jackspeak@3.1.2 jiti@1.21.0 js-tokens@4.0.0 js-yaml@4.1.0 json-buffer@3.0.1 json-schema-traverse@0.4.1 json-stable-stringify-without-jsonify@1.0.1 json5@1.0.2 jsx-ast-utils@3.3.5 keyv@4.5.4 language-subtag-registry@0.3.23 language-tags@1.0.9 levn@0.4.1 lilconfig@2.1.0 lilconfig@3.1.1 lines-and-columns@1.2.4 locate-path@6.0.0 lodash.merge@4.6.2 loose-envify@1.4.0 lru-cache@10.2.2 merge2@1.4.1 micromatch@4.0.7 minimatch@3.1.2 minimatch@9.0.3 minimatch@9.0.4 minimatch@9.0.4 minimist@1.2.8 minipass@7.1.2 ms@2.1.2 ms@2.1.3 ms@2.1.3 ms@2.1.3 mz@2.7.0 nanoid@3.3.7 natural-compare@1.4.0 next@14.2.3 normalize-path@3.0.0 object-assign@4.1.1 object-hash@3.0.0 object-inspect@1.13.1 object-keys@1.1.1 object.assign@4.1.5 object.entries@1.1.8 object.fromentries@2.0.8 object.groupby@1.0.3 object.hasown@1.1.4 object.values@1.2.0 once@1.4.0 optionator@0.9.4 p-limit@3.1.0 p-locate@5.0.0 parent-module@1.0.1 path-exists@4.0.0 path-is-absolute@1.0.1 path-key@3.1.1 path-parse@1.0.7 path-scurry@1.11.1 path-type@4.0.0 picocolors@1.0.1 picomatch@2.3.1 pify@2.3.0 pirates@4.0.6 possible-typed-array-names@1.0.0 postcss@8.4.31 postcss@8.4.38 postcss-import@15.1.0 postcss-js@4.0.1 postcss-load-config@4.0.2 postcss-nested@6.0.1 postcss-selector-parser@6.1.0 postcss-value-parser@4.2.0 prelude-ls@1.2.1 prop-types@15.8.1 punycode@2.3.1 queue-microtask@1.2.3 react@18.3.1 react-dom@18.3.1 react-is@16.13.1 read-cache@1.0.0 readdirp@3.6.0 reflect.getprototypeof@1.0.6 regenerator-runtime@0.14.1 regexp.prototype.flags@1.5.2 resolve@1.22.8 resolve@2.0.0-next.5 resolve-from@4.0.0 resolve-pkg-maps@1.0.0 reusify@1.0.4 rimraf@3.0.2 run-parallel@1.2.0 safe-array-concat@1.1.2 safe-regex-test@1.0.3 scheduler@0.23.2 semver@6.3.1 semver@6.3.1 semver@7.6.2 set-function-length@1.2.2 set-function-name@2.0.2 shebang-command@2.0.0 shebang-regex@3.0.0 side-channel@1.0.6 signal-exit@4.1.0 slash@3.0.0 source-map-js@1.2.0 streamsearch@1.1.0 string-width@4.2.3 string-width@4.2.3 string-width@5.1.2 string.prototype.matchall@4.0.11 string.prototype.trim@1.2.9 string.prototype.trimend@1.0.8 string.prototype.trimstart@1.0.8 strip-ansi@6.0.1 strip-ansi@6.0.1 strip-ansi@6.0.1 strip-ansi@6.0.1 strip-ansi@7.1.0 strip-ansi@7.1.0 strip-ansi@7.1.0 strip-bom@3.0.0 strip-json-comments@3.1.1 styled-jsx@5.1.1 sucrase@3.35.0 supports-color@7.2.0 supports-preserve-symlinks-flag@1.0.0 tailwindcss@3.4.3 tapable@2.2.1 text-table@0.2.0 thenify@3.3.1 thenify-all@1.6.0 to-regex-range@5.0.1 ts-api-utils@1.3.0 ts-interface-checker@0.1.13 tsconfig-paths@3.15.0 tslib@2.6.2 type-check@0.4.0 type-fest@0.20.2 typed-array-buffer@1.0.2 typed-array-byte-length@1.0.1 typed-array-byte-offset@1.0.2 typed-array-length@1.0.6 typescript@5.4.5 unbox-primitive@1.0.2 undici-types@5.26.5 uri-js@4.4.1 util-deprecate@1.0.2 which@2.0.2 which-boxed-primitive@1.0.2 which-builtin-type@1.1.3 which-collection@1.0.2 which-typed-array@1.1.15 word-wrap@1.2.5 wrap-ansi@7.0.0 wrap-ansi@8.1.0 wrappy@1.0.2 yaml@2.4.2 yocto-queue@0.1.0 -- END HASH-- 🔒 Saving lockfile... Saving 32 trees Saving 370 hoisted_dependencies Saving 739 resolutions Saving 739 dependencies Saving 12 extern_strings Saving 27699 string_bytes EINVAL: Failed to replace old lockfile with new lockfile on disk ```
marceloclp commented 1 week ago

Also fails when running from WSL.

EDIT: installing Bun using a different method seems to have fixed the issue. I initially had installed using npm, and now installed using curl.