Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Error: Can't resolve 'fs' in readline.js #29

Open
fridolinvii opened this issue Mar 14, 2022 · 1 comment
Open

Module not found: Error: Can't resolve 'fs' in readline.js #29

fridolinvii opened this issue Mar 14, 2022 · 1 comment

Comments

@fridolinvii
Copy link

I am trying to import input in my App.js file
import input from 'input';

However I get the following issue:
Module not found: Error: Can't resolve 'fs' in './node_modules/readline'

I already tried

@Kazbonfim
Copy link

Tried this instead? (just look at the starting lines, as i'm learning node and its correlatives now)

`const fs = require('fs'); // File System;
const path = require('path');

const filePath = path.join('D:', 'Faculdade', 'cursoDeNode', 'MatheusBattisti', '1_INTRO', '2_usando_modulos', 'arquivo.txt')
console.log(filePath);

// fs.readFile([arquivo], [syntax], [try/catch])
fs.readFile(filePath, 'utf8', (err, data) => {
if (err) {
console.log(err);
}
console.log(data);
});

// Sucesso!!
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants