安装node-config和@types/config后:
npm install config
npm install @types/config当我尝试在我的应用中使用时:
import config from 'config';我得到了一个错误:
Module not found: Error: Can't resolve 'fs'我安装了'fs'模块,但仍然收到这个错误。
Module not found: Error: Can't resolve 'fs'发布于 2018-08-17 21:10:21
这听起来像是您试图在前端代码中使用node-config,或者在fs模块不可用的地方使用React Native。这是不支持的)https://github.com/lorenwest/node-config/issues/367)。
在Node.js中使用fs时,应该不需要安装node-config模块-- fs模块内置于Node.js中。
https://stackoverflow.com/questions/51258928
复制相似问题