最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - pnpm and npm cannot start a vite server nor install package, with error code 3221225477 - Stack Overflow

programmeradmin1浏览0评论

The problem is that it do it's job flawlessly yesterday, and somehow doesn't work now. The only possible relevance in the process is a python backend server I tested, which did not use the same port anyways. The problem only happen on my machine, and works perfect when on other machine. So I'd like to ask how to identify what is in my way and try to solve them.

What I tried

I've tried similar posts' solution such as adjust firewall, reinstall node and npm, reinstall packages and clear cache, but none worked and I had no clue even if I looked through the script it tries to run.
These are the error I received:

node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script...

node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, failed in 101ms

.../[email protected]/node_modules/esbuild postinstall$ node install.js

└─ Failed in 101ms at (...)\GitHub\2025-AI-glucose\glutose-FE\node_modules\.pnpm\[email protected]\node_modules\esbuild

\[email protected]\node_modules\esbuild

node_modules/.pnpm/[email protected][email protected]/node_modules/vue-demi: Running postinstall script, failed in 87msE  Command failed with exit code 3221225477.

.../node_modules/vue-demi postinstall$ node -e "try{require('./scripts/postinstall.js')}catch(e){}"

└─ Failed in 87ms at (...)\GitHub\2025-AI-glucose\glutose-FE\node_modules\.pnpm\[email protected][email protected]\node_modules\vue-demi

ELIFECYCLE  Command failed with exit code 3221225477.

EDIT: and here's what npm reported

2905 info run [email protected] postinstall node_modules/esbuild node install.js
2906 info run [email protected] postinstall node_modules/vue-demi node -e "try{require('./scripts/postinstall.js')}catch(e){}"
2907 info run [email protected] postinstall { code: 3221225477, signal: null }
2908 info run [email protected] postinstall { code: 3221225477, signal: null }
2909 warn cleanup Failed to remove some directories [
2909 warn cleanup   [
2909 warn cleanup     '\\\\?\\C:\\Users\\creap\\OneDrive\\文件\\GitHub\\2025-AI-glucose\\glutose-FE\\node_modules\\vue-demi',
2909 warn cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\creap\OneDrive\文件\GitHub\2025-AI-glucose\glutose-FE\node_modules\vue-demi'] {
2909 warn cleanup       errno: -4082,
2909 warn cleanup       code: 'EBUSY',
2909 warn cleanup       syscall: 'rmdir',
2909 warn cleanup       path: 'C:\\Users\\creap\\OneDrive\\文件\\GitHub\\2025-AI-glucose\\glutose-FE\\node_modules\\vue-demi'
2909 warn cleanup     }
2909 warn cleanup   ],
2909 warn cleanup   [
2909 warn cleanup     '\\\\?\\C:\\Users\\creap\\OneDrive\\文件\\GitHub\\2025-AI-glucose\\glutose-FE\\node_modules',
2909 warn cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\creap\OneDrive\文件\GitHub\2025-AI-glucose\glutose-FE\node_modules\vue-demi'] {
2909 warn cleanup       errno: -4082,
2909 warn cleanup       code: 'EBUSY',
2909 warn cleanup       syscall: 'rmdir',
2909 warn cleanup       path: 'C:\\Users\\creap\\OneDrive\\文件\\GitHub\\2025-AI-glucose\\glutose-FE\\node_modules\\vue-demi'
2909 warn cleanup     }
2909 warn cleanup   ]
2909 warn cleanup ]

The problem is that it do it's job flawlessly yesterday, and somehow doesn't work now. The only possible relevance in the process is a python backend server I tested, which did not use the same port anyways. The problem only happen on my machine, and works perfect when on other machine. So I'd like to ask how to identify what is in my way and try to solve them.

What I tried

I've tried similar posts' solution such as adjust firewall, reinstall node and npm, reinstall packages and clear cache, but none worked and I had no clue even if I looked through the script it tries to run.
These are the error I received:

node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script...

node_modules/.pnpm/[email protected]/node_modules/esbuild: Running postinstall script, failed in 101ms

.../[email protected]/node_modules/esbuild postinstall$ node install.js

└─ Failed in 101ms at (...)\GitHub\2025-AI-glucose\glutose-FE\node_modules\.pnpm\[email protected]\node_modules\esbuild

\[email protected]\node_modules\esbuild

node_modules/.pnpm/[email protected][email protected]/node_modules/vue-demi: Running postinstall script, failed in 87msE  Command failed with exit code 3221225477.

.../node_modules/vue-demi postinstall$ node -e "try{require('./scripts/postinstall.js')}catch(e){}"

└─ Failed in 87ms at (...)\GitHub\2025-AI-glucose\glutose-FE\node_modules\.pnpm\[email protected][email protected]\node_modules\vue-demi

ELIFECYCLE  Command failed with exit code 3221225477.

EDIT: and here's what npm reported

2905 info run [email protected] postinstall node_modules/esbuild node install.js
2906 info run [email protected] postinstall node_modules/vue-demi node -e "try{require('./scripts/postinstall.js')}catch(e){}"
2907 info run [email protected] postinstall { code: 3221225477, signal: null }
2908 info run [email protected] postinstall { code: 3221225477, signal: null }
2909 warn cleanup Failed to remove some directories [
2909 warn cleanup   [
2909 warn cleanup     '\\\\?\\C:\\Users\\creap\\OneDrive\\文件\\GitHub\\2025-AI-glucose\\glutose-FE\\node_modules\\vue-demi',
2909 warn cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\creap\OneDrive\文件\GitHub\2025-AI-glucose\glutose-FE\node_modules\vue-demi'] {
2909 warn cleanup       errno: -4082,
2909 warn cleanup       code: 'EBUSY',
2909 warn cleanup       syscall: 'rmdir',
2909 warn cleanup       path: 'C:\\Users\\creap\\OneDrive\\文件\\GitHub\\2025-AI-glucose\\glutose-FE\\node_modules\\vue-demi'
2909 warn cleanup     }
2909 warn cleanup   ],
2909 warn cleanup   [
2909 warn cleanup     '\\\\?\\C:\\Users\\creap\\OneDrive\\文件\\GitHub\\2025-AI-glucose\\glutose-FE\\node_modules',
2909 warn cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\creap\OneDrive\文件\GitHub\2025-AI-glucose\glutose-FE\node_modules\vue-demi'] {
2909 warn cleanup       errno: -4082,
2909 warn cleanup       code: 'EBUSY',
2909 warn cleanup       syscall: 'rmdir',
2909 warn cleanup       path: 'C:\\Users\\creap\\OneDrive\\文件\\GitHub\\2025-AI-glucose\\glutose-FE\\node_modules\\vue-demi'
2909 warn cleanup     }
2909 warn cleanup   ]
2909 warn cleanup ]
Share Improve this question edited Mar 20 at 20:35 marc_s 757k184 gold badges1.4k silver badges1.5k bronze badges asked Dec 28, 2024 at 2:37 Creaper9487Creaper9487 311 silver badge4 bronze badges 5
  • 1 What are npm and node versions? What is the output with npm? Try to clear npm cache and make a fresh copy of the project and reinstall deps, i.e remove node_modules and keep package lock, in case there's one. " works perfect when on other machine" - how do os and node versions differ? 3221225477 is windows ACCESS_VIOLATION error, so it's possibly not related to node at all. Tried to reboot at least? – Estus Flask Commented Dec 28, 2024 at 7:56
  • @EstusFlask node 22.12.2 and 11.0.0 npm. I will put npm log on the post if I can find them soon. The OS on other machine is the same build and architecture, So there is no diffrence as far as I could think of. Reboot and switch user does not work too – Creaper9487 Commented Dec 28, 2024 at 14:47
  • 1 I'd suggest to stick to npm 10 to not cause additional problems. But it's most likely not related. In addition to the previous comment, try also installing another node lts version (20) and running it as admin. The other causes are less convenient learn.microsoft/en-us/shows/inside/c0000005 – Estus Flask Commented Dec 28, 2024 at 14:57
  • @EstusFlask The problem disappeared after I installed node 20 lts, I rebuilt my packages. No additional privilege is required. I'd assume it is a problem of the newer version not compatible with my modules. Thank you for these instruction. Wish you have a nice year ahead. – Creaper9487 Commented Dec 28, 2024 at 17:43
  • Same to you. Glad it was that simple. I could understand why esbuild, but vue-demi is cryptic at least. Could be a bug in node. I'd suggest to try other versions of 22 and 23 if you're forced to use the latest – Estus Flask Commented Dec 28, 2024 at 17:55
Add a comment  | 

1 Answer 1

Reset to default 1

The solution is simple. And I tried to find some potential cause of it worked then did't work overnight.

The solution

The solution is provided by @Estus Flask . I removed my existing node installation (22 lts) and used node 20 lts instead. with both npm and node are lower version, the script that was previously not able to run passed. I would suggest future me or anyone struggle to do the same (use a slightly older version of npm and node), delete your node-module, then rebuild your modules.

The potential cause

I usually mindlessly update my node whenever there's notification in my terminal. Seems like it is not a good thing. Please avoid it if you like to do whatever they said in terminal like I did.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论