React Js require 'fs'

前端 未结 2 386
悲&欢浪女
悲&欢浪女 2020-12-17 10:46

I have

import fs from \'fs\'

and in my package.json I have

Then I run the command

2条回答
  •  悲&欢浪女
    2020-12-17 11:17

    In create-react-app they have stubbed out 'fs'. You cannot import it. They did this because fs is a node core module.
    You'll have to find another solution to that problem. See this ticket.

提交回复
热议问题