I have
import fs from \'fs\'
and in my package.json I have
Then I run the command
It's possible this might be an environment issue. It's not possible for the browser to interpret and run some Node server-side modules like fs.
The solution is to run the fs methods in a Node environment (server-side) or to find a package which offers the same functionality but written for the browser.
It's discussed in this question... Module not found: Error: Cannot resolve module 'fs'
And this question... Use fs module in React.js,node.js, webpack, babel,express