ModulebuilderRor: Modul Build fehlgeschlagen (von.
npm rebuild node-sass
Cloudy Capuchin
npm rebuild node-sass
Have you created a package.json file? Maybe run this command first again.
C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm init
It creates a package.json file in your folder.
Then run,
C:\Users\Nuwanst\Documents\NodeJS\3.chat>npm install socket.io --save
The --save ensures your module is saved as a dependency in your package.json file.
I address this issue: https://www.youtube.com/watch?v=crmlD78OzaA&ab_channel=Pioneer3DStudios
export async function getFiles(dir: string): Promise<string[]> {
const cwd = await path.resolve(process.cwd(), dir) // this magic is use process.cwd
const dirents: string[] = await fs.readDirSync(cwd)
const files: any[] = dirents.map((val: any): any => {
return val.isDirectory() ? getFiles(val.name) : val.name
})
return dirents.length > 0 ? Array.prototype.concat(...files) : []
}