小编Aït*_*ock的帖子

我无法理解“找不到模块:错误:无法解析'fs''”

有一点空闲时间,我尝试用我喜欢的新网络技术(Typescript、Pug 和 React)重新设计我的一个旧项目。一切都工作正常,直到我尝试将 pug.js 添加到与babel-plugin-transform-react-pug.

无论我如何摆弄配置,我都无法让构建阶段正常工作并出现以下错误:

ERROR in ./node_modules/uglify-js/tools/node.js
Module not found: Error: Can't resolve 'fs'

ERROR in ./node_modules/resolve/lib/sync.js
Module not found: Error: Can't resolve 'fs'

ERROR in ./node_modules/resolve/lib/async.js
Module not found: Error: Can't resolve 'fs'

ERROR in ./node_modules/pug-load/index.js
Module not found: Error: Can't resolve 'fs'

ERROR in ./node_modules/jstransformer/index.js
Module not found: Error: Can't resolve 'fs'

ERROR in ./node_modules/clean-css/lib/reader/load-original-sources.js
Module not found: Error: Can't resolve 'fs'

ERROR in ./node_modules/clean-css/lib/reader/apply-source-maps.js
Module not found: Error: Can't resolve 'fs'

ERROR in …
Run Code Online (Sandbox Code Playgroud)

javascript typescript reactjs webpack babeljs

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

babeljs ×1

javascript ×1

reactjs ×1

typescript ×1

webpack ×1