I have a root folder where I install my node modules. I have different serverless projects inside subsubfolders like this: project-root/services/serverless-app1.
When I try to run/deploy my app I get an ENOENT error because it's looking for modules inside the serverless folder instead of the root folder.
This error only happens when I'm using the serverless-plugin-typescript. Other modules and plugins work fine. I'm not sure if this is an graceful-fs error or the plugins'.
functions/post-offer.js (1,30): File 'C:/Monkey Minds/Repositories/chen-de-ext-api/libs/dynamodb-lib.js' is not under 'rootDir' './'. 'rootDir' is expected to contain all source files.
functions/post-offer.js (3,34): File 'C:/Monkey Minds/Repositories/chen-de-ext-api/libs/response-lib.js' is not under 'rootDir' './'. 'rootDir' is expected to contain all source files.
Serverless: Typescript compiled.
Error --------------------------------------------------
Error: ENOENT: no such file or directory, stat 'C:\Monkey Minds\Repositories\chen-de-ext-api\services\admin-app-api\node_modules'
at Object.statSync (fs.js:932:3)
at Object.<anonymous> (C:\Users\jingy\AppData\Roaming\npm\node_modules\serverless\node_modules\graceful-fs\polyfills.js:308:16)
at Object.statSync (C:\Monkey Minds\Repositories\chen-de-ext-api\node_modules\graceful-fs\polyfills.js:308:16)
at checkStats (C:\Monkey Minds\Repositories\chen-de-ext-api\node_modules\fs-extra\lib\copy-sync\copy-sync.js:171:22)
at checkPaths (C:\Monkey Minds\Repositories\chen-de-ext-api\node_modules\fs-extra\lib\copy-sync\copy-sync.js:183:31)
at Object.copySync (C:\Monkey Minds\Repositories\chen-de-ext-api\node_modules\fs-extra\lib\copy-sync\copy-sync.js:25:20)
at TypeScriptPlugin.<anonymous> (C:\Monkey Minds\Repositories\chen-de-ext-api\node_modules\serverless-plugin-typescript\src\index.ts:198:10)
at Generator.next (<anonymous>)
at C:\Monkey Minds\Repositories\chen-de-ext-api\node_modules\serverless-plugin-typescript\dist\src\index.js:7:71
at new Promise (<anonymous>)
at __awaiter (C:\Monkey Minds\Repositories\chen-de-ext-api\node_modules\serverless-plugin-typescript\dist\src\index.js:3:12)
at TypeScriptPlugin.copyDependencies (C:\Monkey Minds\Repositories\chen-de-ext-api\node_modules\serverless-plugin-typescript\dist\src\index.js:166:16)
at TypeScriptPlugin.<anonymous> (C:\Monkey Minds\Repositories\chen-de-ext-api\node_modules\serverless-plugin-typescript\src\index.ts:45:20)
at Generator.next (<anonymous>)
at fulfilled (C:\Monkey Minds\Repositories\chen-de-ext-api\node_modules\serverless-plugin-typescript\dist\src\index.js:4:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at runNextTicks (internal/process/task_queues.js:66:3)
at processImmediate (internal/timers.js:429:9)
at process.topLevelDomainCallback (domain.js:137:15)
Notice how modules are first correctly loaded from chen-de-ext-api which is my project root folder but somehow at the end it starts looking for stuff inside admin-app-api.
graceful-fs does not modify filename arguments, I suspect this is an error elsewhere. The fact that graceful-fs appears in backtraces does not mean it is responsible for errors.
I think this has something to do with the way my project is structured. I got the error when using the typescript plugin for serverless.
serverless-plugin-typescript -> requires: fs-extra -> requires graceful-fs
I have a root folder where I install my node modules. I have different serverless projects inside subsubfolders like this: project-root/services/serverless-app1. When I try to run/deploy my app I get an ENOENT error because it's looking for modules inside the serverless folder instead of the root folder.
This error only happens when I'm using the serverless-plugin-typescript. Other modules and plugins work fine. I'm not sure if this is an graceful-fs error or the plugins'.
Notice how modules are first correctly loaded from chen-de-ext-api which is my project root folder but somehow at the end it starts looking for stuff inside admin-app-api.