@mstdmstd That‘s a Node module for reading and writing files on the server. Why are you trying to bundle this in client-side code?
Jun 29, 2022
5
Level 8
How to use functions readFile and writeFile of "fs/promises" ?
In laravel 8 app I need to use functions readFile and writeFile of "fs/promises" I suppose this library is already installed with node js, so in resources/js/bootstrap.js I added line :
window.fs_promises = require('fs/promises');
but I got error in npm line :
Module not found: Error: Can't resolve 'fs/promises' in '/home/vagrant/code/app/resources/js'
in package.json :
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"@popperjs/core": "^2.10.2",
"axios": "^0.21",
"bootstrap": "^5.1.3",
"laravel-mix": "^6.0.6",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"resolve-url-loader": "^5.0.0",
"sass": "^1.32.11",
"sass-loader": "^11.0.1"
},
"dependencies": {
"uuid": "^8.3.2"
}
}
Do I lack some libraries ?
Thanks!
Please or to participate in this conversation.