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

Running bun install fails on windows (NtSetInformationFile()) #9830

Closed
CEbbinghaus opened this issue Apr 2, 2024 · 21 comments
Closed

Running bun install fails on windows (NtSetInformationFile()) #9830

CEbbinghaus opened this issue Apr 2, 2024 · 21 comments
Labels
bug Something isn't working

Comments

@CEbbinghaus
Copy link

CEbbinghaus commented Apr 2, 2024

What version of Bun is running?

v1.1.0 (5903a61)

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

What is the expected behavior?

It to properly install all the dependencies (albeit not considering the pnpm lock)

What do you see instead?

bun install v1.1.0 (5903a614)
  🚚 timer [124/132] error: InstallFailed extracting tarball for timer
error: package "@cebbinghaus/microsdeck" is not linked

To install a linked package:
   bun link my-pkg-name-from-package-json

Tip: the package name is from package.json, which can differ from the folder name.


error: moving "timer" to cache dir failed: EEXIST: File or folder exists (NtSetInformationFile())
  From: .17c2652eb92e3bed-00000001.timer
    To: @GH@CEbbinghaus-Timer-38d27cc

Additional information

It seems that the linking is a whole seperate problem. I have managed to get the moving error to appear entirely independent of the linking error in repositories that don't use links. The link error can be considered as an entirely different problem. Although in this case both appear at the same time.

@CEbbinghaus CEbbinghaus added the bug Something isn't working label Apr 2, 2024
@CEbbinghaus
Copy link
Author

This issue seems to be distinct from #9808 even if one of the people in that thread has the same error appear (albeit only after deleting the bun lock file)

@bonyjose
Copy link

bonyjose commented Apr 2, 2024

i have a similar issue running "bun install" in my Angular app directory, works fine with "npm install"
i have manually deleted node_modules folder before running the command, attaching my package.json below.
image
package-lock.json
package.json

@KrishGarg
Copy link

+1
was trying out bun, tried installing a few global packages and a "create remix" app, both gave this error.
tried using an admin shell, the issue persisted.

E:\*USER*\code>bun create remix remix-bun
  🔍 through2 [105/168] error: InstallFailed extracting tarball for semver
error: moving "semver" to cache dir failed: EPERM: Operation not permitted (NtSetInformationFile())
  From: .17c2871b75d37b6c-00000004.semver
    To: semver@7.6.0

@AwesomeKalin
Copy link

I got this error too, but when I used bun.exe i instead, it just worked!

@maciejadamski89
Copy link

Solution by @AwesomeKalin works for me as well!

> bun install

[2.00ms] ".env"
bun install v1.1.0 (5903a614)
  🚚 @tanstack/react-query... error: InstallFailed extracting tarball for @tanstack/react-query
error: moving "@tanstack/react-query" to cache dir failed: EPERM: Operation not permitted (NtSetInformationFile())
  From: .17c2c8044b2b0f9a-00000001.react-query
    To: @tanstack\react-query@5.28.6
> bun.exe install

[12.00ms] ".env"
bun install v1.1.0 (5903a614)

 + @prisma/client@5.11.0
 + @radix-ui/react-dialog@1.0.5
 + @radix-ui/react-slot@1.0.2
 + @radix-ui/react-toast@1.1.5
 + @tanstack/react-query@5.28.6
 + @trpc/client@11.0.0-next.320
 + @trpc/next@11.0.0-next.320
 + @trpc/react-query@11.0.0-next.320
 + @trpc/server@11.0.0-next.320
 + class-variance-authority@0.7.0
 + clsx@2.1.0
 + lucide-react@0.363.0 (v0.364.0 available)
 + next@14.1.4
 + react@18.2.0
 + react-dom@18.2.0
 + tailwind-merge@2.2.2
 + tailwindcss-animate@1.0.7
 + zod@3.22.4
 + @types/node@20.11.30 (v20.12.2 available)
 + @types/react@18.2.69 (v18.2.73 available)
 + @types/react-dom@18.2.22 (v18.2.23 available)
 + autoprefixer@10.4.19
 + eslint@8.57.0
 + eslint-config-next@14.1.4
 + postcss@8.4.38
 + prisma@5.11.0
 + tailwindcss@3.4.1 (v3.4.3 available)
 + typescript@5.4.3

 416 packages installed [47.28s]

@Jarred-Sumner
Copy link
Collaborator

Fixed in #9729, please try again after running bun upgrade --canary in about an hour (or wait for Bun v1.1.1). Let us know if you run into this again.

@maciejadamski89
Copy link

@Jarred-Sumner

> bun install

[7.00ms] ".env"
bun install v1.1.1 (c8f5c9f2)
  📦 Installing [426/412] error loading current directory
  📦 Installing [426/412]
error: failed to spawn life-cycle scripts for @prisma/engines: CouldntReadCurrentDirectory
  ⚙️  prisma [1/3] bun: command not found: node

error: postinstall script from "@prisma/client" exited with 1
> bun.exe install

[1.00ms] ".env"
bun install v1.1.1 (c8f5c9f2)
  📦 Installing [420/412] error loading current directory
  📦 Installing [426/412]
error: failed to spawn life-cycle scripts for @prisma/engines: CouldntReadCurrentDirectory
  ⚙️  prisma [1/3] bun: command not found: node

error: postinstall script from "@prisma/client" exited with 1

But directly after that when I do another bun install / bun.exe install:

[1.00ms] ".env"
bun install v1.1.1 (c8f5c9f2)

 + @trpc/client@11.0.0-rc.330
 + @trpc/next@11.0.0-rc.330
 + @trpc/react-query@11.0.0-rc.330
 + @trpc/server@11.0.0-rc.330

 4 packages installed [2.58s]

But:

> bun run dev / bun --bun run dev

error loading current directory
???:?:?: 0x7ff63741c27d in ??? (bun.exe)
???:?:?: 0x7ff637504b1f in ??? (bun.exe)
???:?:?: 0x7ff6375198d0 in ??? (bun.exe)

error: CouldntReadCurrentDirectory

----- bun meta -----
Bun v1.1.1 (c8f5c9f2) Windows x64
RunCommand:
Elapsed: 8ms | User: 0ms | Sys: 31ms
RSS: 21.32MB | Peak: 21.32MB | Commit: 62.56MB | Faults: 5436
----- bun meta -----

0   00007FF6388CEE48
1   ???
2   ???
3   ???
4   ???
5   ???

Search GitHub issues https://bun.sh/issues or join in #windows channel in https://bun.sh/discord

After upgrading to --canary I am not able to run my project with bun anymore.

Packages

 "dependencies": {
        "@prisma/client": "^5.11.0",
        "@radix-ui/react-dialog": "^1.0.5",
        "@radix-ui/react-slot": "^1.0.2",
        "@radix-ui/react-toast": "^1.1.5",
        "@tanstack/react-query": "^5.28.6",
        "@trpc/client": "^11.0.0-next.320",
        "@trpc/next": "^11.0.0-next.320",
        "@trpc/react-query": "^11.0.0-next.320",
        "@trpc/server": "^11.0.0-next.320",
        "class-variance-authority": "^0.7.0",
        "clsx": "^2.1.0",
        "lucide-react": "^0.363.0",
        "next": "14.1.4",
        "react": "^18",
        "react-dom": "^18",
        "tailwind-merge": "^2.2.2",
        "tailwindcss-animate": "^1.0.7",
        "zod": "^3.22.4"
    },
    "devDependencies": {
        "@types/node": "^20",
        "@types/react": "^18",
        "@types/react-dom": "^18",
        "autoprefixer": "^10.0.1",
        "eslint": "^8",
        "eslint-config-next": "14.1.4",
        "postcss": "^8",
        "prisma": "^5.11.0",
        "tailwindcss": "^3.3.0",
        "typescript": "^5"
    }

@Jarred-Sumner
Copy link
Collaborator

@maciejadamski89 was the current working directory deleted? That's what the error implies

What does the "dev" script do?

@bonyjose
Copy link

bonyjose commented Apr 4, 2024

Fixed in #9729, please try again after running bun upgrade --canary in about an hour (or wait for Bun v1.1.1). Let us know if you run into this again.

When running "bun i" in Canary build within a clean directory, it throws an error for the first time. However, when run again, it somehow works, and the dependencies are installed correctly

bun error

@Jarred-Sumner
Copy link
Collaborator

okay hm

is there a chance you could paste the package.json + package-lock.json?

@bonyjose
Copy link

bonyjose commented Apr 4, 2024

okay hm

is there a chance you could paste the package.json + package-lock.json?

#9830 (comment)

please get it from attachment here.

@maciejadamski89
Copy link

@maciejadamski89 was the current working directory deleted? That's what the error implies

What does the "dev" script do?

image

image

@Jarred-Sumner
Copy link
Collaborator

@maciejadamski89 can you run bun upgrade --canary and try again once more? i pushed a fix that requests fewer permissions in most places

@maciejadamski89
Copy link

@Jarred-Sumner
now bun install works well !
bun run dev also - without any problems.

@CEbbinghaus
Copy link
Author

It seems that the original error was not fixed by the canary build v1.1.3:

bun install v1.1.3 (c739c4ad)
  🚚 @babel/compat-data [780/782] error: InstallFailed extracting tarball for @babel/helpers
error: package "@cebbinghaus/microsdeck" is not linked

To install a linked package:
   bun link my-pkg-name-from-package-json

Tip: the package name is from package.json, which can differ from the folder name.


error: moving "@babel/helpers" to cache dir failed
EPERM: Operation not permitted (NtSetInformationFile())
  From: .fff7fffbddbbbf37-0000001E.helpers
    To: @babel/helpers@7.24.4

@maciejadamski89
Copy link

It's again tarball 🤔. I had this issue in bun 1.1.0. @Jarred-Sumner could you please have a look ? @CEbbinghaus please share your package.json in mean time.

@CEbbinghaus
Copy link
Author

@maciejadamski89 I shared the source code of the entire project in the original issue description. This also includes the package.json. All tests are ran against a freshly cloned copy of that repository.

@Jarred-Sumner
Copy link
Collaborator

@CEbbinghaus this error should be fixed in v1.1.3:

error: InstallFailed extracting tarball for timer
error: moving "timer" to cache dir failed: EEXIST: File or folder exists (NtSetInformationFile())
  From: .17c2652eb92e3bed-00000001.timer
    To: @GH@CEbbinghaus-Timer-38d27cc

This error here is not a bug:

error: package "@cebbinghaus/microsdeck" is not linked

To install a linked package:
   bun link my-pkg-name-from-package-json

link is globally shared across all projects and must be registered. You might've meant workspace: instead.

@huangkaoya
Copy link

I also meet this problem in version of Bun 1.1.6,anybody meets this else?

@devybh
Copy link

devybh commented May 1, 2024

I solved it with the command bun i --force

@bamf2077
Copy link

bamf2077 commented May 11, 2024

Same command failed first time, but worked on retrying.

$ bun install
bun install v1.1.8 (89d25807)
  🔍 @types/node [362/646] error: InstallFailed extracting tarball for spawn-command
error: moving "spawn-command" to cache dir failed
EPERM: Operation not permitted (NtSetInformationFile())
  From: .17df6fff4e6feefe-0000002C.spawn-command
    To: spawn-command@0.0.2@@mirrors.cloud.tencent.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants