0
我正在使用create-react-app来构建Node项目。如何解决“Node not found中的模块:'readline'”节点项目
我已经使用npm -i --save-dev sat-words
来安装一个名为sat-words
的模块。然而,当我运行该项目,它告诉我
Module not found: 'readline' ...
在sat-words
的index.js
文件,它使用readline
读取文本文件,如:
var rl = require('readline').createInterface({
input: require('fs').createReadStream(__dirname + '/word-list.txt')
});
但Node.js的文档readline
在是一个核心模块。为什么会抛出一个错误,指出模块在运行时没有找到?
create-react-app将所有js文件放在src'文件夹中。我使用'npm start'命令来运行程序。 – newguy