I am creating a SPFx web part which is using fs
module, but getting error Error: Can't resolve 'fs'
. I know this issue causing from typescript
because of missing typings. Following is the exact error what my web part is displaying
***ERROR MESSAGE:
***Failed to load component "79bb3b95-9a04-44d5-8c56-6a8f6c93cf45" (SaketaIntranetManagerWebPart).
Original error: ***Failed to load entry point from component "79bb3b95-9a04-44d5-8c56-6a8f6c93cf22" (HelloWorld).
Original error: Error loading https://component-id.invalid/79bb3b95-9a04-44d5-8c56-6a8f6c93cf22_0.0.1 Cannot find module "fs"
***CALLSTACK:
_loadComponentImpl/<@https://localhost:4321/node_modules/@microsoft/sp-loader/dist/sp-loader_en-us.js:16232:21
I also tried running this command typings install dt~node --global --save
but getting duplicate identifier issue after that. How to resolve this issue?
npm install --save @types/node
?Module not found: Error: Can't resolve 'fs'