问题描述
在Windows中执行以下步骤后会发生错误:
The error occurs after following steps in windows:
- 打开一个终端:
npm run start:dev
- 打开另一个终端:
ng build --watch
但是,通过使用以上命令,它可以在Mac中工作.package.json配置的一部分是:
However, it works in Mac by using the above commands. Part of the package.json configuration are:
"scripts": {
"ng": "ng",
"start:dev:prod": "ng build --prod && cd dist/ && node static/server.js",
"start": "node static/server.js",
"build:prod": "ng build --prod",
"test": "ng test --code-coverage",
"lint": "ng lint",
"e2e": "ng e2e",
"start:dev": "npm run build & cd dist/ & SET APP_ENV=dev & node static/server.js",
"build": "ng build"
},
错误日志:
Error: EBUSY: resource busy or locked, rmdir 'C:\AngularProject\dist'
Error: EBUSY: resource busy or locked, rmdir 'C:\Spring-Intern-Projects\wdpr-accounting-reference-client\dist'
at Object.rmdirSync (fs.js:701:3)
推荐答案
如果上述所有解决方案均不起作用,而您在使用Windows PC的情况下(例如我的情况),最简单的方法是:
If all the above solutions did not work AND you are using windows PC like in my case, the easiest thing to do is:
-
按键盘上的 Windows键加 R 打开运行命令框,然后键入
Press windows key plus R on your keyboard to open the run command box and type this
resmon.exe
resmon.exe
单击确定以打开资源监视器
现在,继续尝试在文件或文件夹上执行的操作.就我而言,我在通过npm使用 react-create-app 时遇到问题.此处的更多信息#117908
Now, continue what you were trying to do on the file or folder. In my case i was having problems using react-create-app via npm.More information here #117908
我只是希望它能对某人有所帮助.
I just hope it helps someone.
这篇关于错误:繁忙:资源繁忙或锁定,rmdir的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!