【发布时间】:2019-09-07 20:26:53
【问题描述】:
我正在使用本教程使用 Django 内置的 API 为前端安装 React。
https://sweetcode.io/how-use-djang-react-ap/
到目前为止,我的这个项目的存储库在这里:
https://github.com/AlexMercedCoder/DjangoReactCRM
我在教程中通过运行“npm run dev”安装 react
这是我得到的错误,没有修改相关文件页面似乎可以解决它:
> webpack --mode development ./frontend/src/components/index.jsx --output
./frontend/static/frontend/main.js
Insufficient number of arguments or no entry found.
Alternatively, run 'webpack(-cli) --help' for usage info.
Hash: 097c83a63f327afef15a
Version: webpack 4.39.3
Time: 80ms
Built at: 09/07/2019 4:16:05 PM
ERROR in Entry module not found: Error: Can't resolve
'./frontend/src/components/index.jsx' in
'C:\Users\alexm\projects\DjangoReactCRM\drcrm'
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! drcrm@1.0.0 dev: `webpack --mode development
./frontend/src/components/index.jsx --output
./frontend/static/frontend/main.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the drcrm@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\alexm\AppData\Roaming\npm-cache\_logs\2019-09-
07T20_16_05_497Z-debug.log
【问题讨论】:
标签: django reactjs django-rest-framework