Sri
Sri

Reputation: 568

Why am I getting this error - Failed to compile. Can't resolve 'modules/App' and "Error from chokidar (E:\): Error: EBUSY: resource busy or locked"?

My react js application was running fine till today, and suddenly a strange error started showing up when try to start my application.

Failed to compile.

./src/index.js
Module not found: Can't resolve 'modules/App' in 'F:\GitRepo\frontend\web\test\packages\employee\src'

followed by another error :

Error from chokidar (E:\): Error: EBUSY: resource busy or locked, lstat 'E:\pagefile.sys'

I went to './src/index.js' and changed the import statement from import App from 'modules/App'; to import App from './modules/App'; the error disappears, only to show up similar error in the next file. In fact this kind of import has been made in multiple files in the project and it was running perfectly. I dont know how suddenly this error is appearing.

Can any one point out what would have gone wrong. Thanks in advance.

Upvotes: 0

Views: 1055

Answers (1)

Sri
Sri

Reputation: 568

After spending hours , I finally figured out that I had set my NODE_PATH variable in the system to 'E:/somepath' while experimenting. This resulted in overriding of NODE_PATH variable holding value './src' present in the project in .env file that indicates the root of the project structure. Since root got changed, 'modules/App' was not found in that path.

Removed the NODE_PATH from the system path variable, and its working now.

Upvotes: 0

Related Questions