Home > other >  I am not able to make files using fs.writeFileSync() in Node.js, idk why?
I am not able to make files using fs.writeFileSync() in Node.js, idk why?

Time:03-04

const fs = require('fs');
const folderName = process.argv[2] || 'Project'


fs.mkdirSync(folderName)
fs.writeFileSync(`${folderName}/index.html`)
fs.writeFileSync(`${folderName}/style.css`)
fs.writeFileSync(`${folderName}/app.js`)

This is the error I am getting when I execute:
node boilerplate.js Portfolio

the folder "Portfolio" is made but not the files

  • Related