相关文章推荐

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 Getting resource busy or locked, lstat 'C:/hiberfil.sys' Error after upgrading in Angular 9 #36270 Getting resource busy or locked, lstat 'C:/hiberfil.sys' Error after upgrading in Angular 9 #36270 Abhilashtiwari0301 opened this issue Mar 26, 2020 · 11 comments

Hi Everyone ,

I am getting locked or busy error while running ng serve , angular 8 working fine, Issue comes when i upgrade angular 9.

Error: EBUSY: resource busy or locked, lstat 'C:/hiberfil.sys'
at Object.lstatSync (fs.js:923:3)
at NodeJSFileSystem.lstat (C:\Angular9-Project\MRR\webapp\src\main\webapp\node_modules@angular\compiler-cli\src\ngtsc\file_system\src\node_js_file_system.js:41:72)
at CachedFileSystem.lstat (C:\Angular9-Project\MRR\webapp\src\main\webapp\node_modules@angular\compiler-cli\src\ngtsc\file_system\src\cached_file_system.js:131:38)
at C:\Angular9-Project\MRR\webapp\src\main\webapp\node_modules@angular\compiler-cli\ngcc\src\entry_point_finder\directory_walker_entry_point_finder.js:102:37
at Array.filter ()
at DirectoryWalkerEntryPointFinder.walkDirectoryForEntryPoints (C:\Angular9-Project\MRR\webapp\src\main\webapp\node_modules@angular\compiler-cli\ngcc\src\entry_point_finder\directory_walker_entry_point_finder.js:101:18)
at DirectoryWalkerEntryPointFinder.findEntryPoints (C:\Angular9-Project\MRR\webapp\src\main\webapp\node_modules@angular\compiler-cli\ngcc\src\entry_point_finder\directory_walker_entry_point_finder.js:53:44)
at analyzeEntryPoints (C:\Angular9-Project\MRR\webapp\src\main\webapp\node_modules@angular\compiler-cli\ngcc\src\main.js:102:41)
at new ClusterMaster (C:\Angular9-Project\MRR\webapp\src\main\webapp\node_modules@angular\compiler-cli\ngcc\src\execution\cluster\master.js:40:30)
at C:\Angular9-Project\MRR\webapp\src\main\webapp\node_modules@angular\compiler-cli\ngcc\src\execution\cluster\executor.js:45:46

Hi @Abhilashtiwari0301 - can you provide some more details about the setup of your project? The idea of this bit of code is that ngcc will walk the file-system looking for Angular libraries to compile. But it should start at the node_modules of your project. In your error message it looks like ngcc is trying to read the C:/hiberfil.sys file. But in normal operation ngcc should never be looking at files in the root of the C: .

hi @petebacondarwin - i am upgraded my app from angular 7 to angular 9 and upgrading to angular 9, not able to ng sreve the project because of the above error, below is the pakage.json

"dependencies": {
"@angular/animations": "~9.0.7",
"@angular/cdk": "~9.1.3",
"@angular/common": "~9.0.7",
"@angular/compiler": "~9.0.7",
"@angular/core": "~9.0.7",
"@angular/elements": "^9.0.7",
"@angular/forms": "~9.0.7",
"@angular/localize": "^9.0.7",
"@angular/platform-browser": "~9.0.7",
"@angular/platform-browser-dynamic": "~9.0.7",
"@angular/router": "~9.0.7",
"@fullcalendar/core": "^4.4.0",
"@ng-bootstrap/ng-bootstrap": "^6.0.0",
"@ng-idle/core": "^8.0.0-beta.4",
"@swimlane/ngx-charts": "^13.0.2",
"@types/jquery": "^3.3.33",
"angular-formio": "^4.6.12",
"babel-polyfill": "^6.26.0",
"bootstrap": "4.4.1",
"chart.js": "^2.9.3",
"core-js": "^2.5.4",
"date.js": "^0.3.3",
"flatpickr": "4.6.3",
"font-awesome": "^4.7.0",
"jquery": "^3.2.1",
"karma": "^4.4.1",
"lodash": "^4.17.11",
"moment": "^2.22.2",
"oidc-client": "^1.6.1",
"popper.js": "^1.16.1",
"primeicons": "^2.0.0",
"primeng": "^9.0.1",
"quill": "^1.3.7",
"rxjs": "^6.3.3",
"rxjs-compat": "6.3.3",
"tslib": "^1.9.0",
"xml-js": "^1.6.11",
"zone.js": "~0.8.26"
"devDependencies": {
"@angular-devkit/build-angular": "~0.900.7",
"@angular/cli": "~9.0.7",
"@angular/compiler-cli": "~9.0.7",
"@angular/language-service": "~9.0.7",
"@types/jasmine": "^3.0.0",
"@types/jasminewd2": "^2.0.0",
"@types/node": "~8.9.4",
"codelyzer": "^5.1.2",
"jasmine-core": "^3.0.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.0.0",
"karma-chrome-launcher": "^3.0.0",
"karma-cli": "^2.0.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-html-reporter": "^0.2.7",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-junit-reporter": "^1.2.0",
"node-sass": "^4.13.1",
"protractor": "^5.4.3",
"ts-node": "~7.0.0",
"tslint": "~6.1.0",
"typescript": "^3.6.4"

ts-config.json

"compileOnSave": false,
"compilerOptions": {
"downlevelIteration": true,
"baseUrl": "/",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/ @types "
"lib": [
"es2018",
"dom"
"paths": {
"rxjs": [
"../WEBAPP/vendor/rxjs.ts"
"@app/ ": ["app/ "],
"os": [
"src/empty.ts"
"types": [
"node"

please let me know if you required any more information to re-produce or to analyse.
Thank you

Is it possible to debug the process by putting a breakpoint at DirectoryWalkerEntryPointFinder.findEntryPoints (C:\Angular9-Project\MRR\webapp\src\main\webapp\node_modules@angular\compiler-cli\ngcc\src\entry_point_finder\directory_walker_entry_point_finder.js:53)

I want to know what this.basePaths is.

You can run ng serve in debug mode by doing:

node --inspect-brk node_modules/.bin/ng serve

Then in your IDE you attach to the debug process.

Alternatively you could just modify the JS code in that file to add console.log(this.basePaths); and run ng serve as before.

hi @petebacondarwin ,
the solution which you given above (Can you try changing "baseUrl": "/", to "baseUrl": "./", in your tsconfig.json) is worked by changing the path in file src/tsconfig.app.json .

Thanks

Oh great! I think that is the correct solution. I thought in #36270 (comment) that you said it didn't work. Glad you have things working again. I'm going to close this.
If you have a recurrence or a different problem please open a new issue, linking to this one if necessary.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

 
推荐文章