【发布时间】:2023-01-09 01:18:54
【问题描述】:
Failed to compile.
Module not found: Error: You attempted to import ../components/App which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
You can either move it inside src/, or add a symlink to it from project's node_modules/.
ERROR in ./src/index.js 6:0-36
Module not found: Error: You attempted to import ../components/App which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.
You can either move it inside src/, or add a symlink to it from project's node_modules/.
webpack compiled with 1 error
当我尝试朗读我的 React 应用程序时出现上述错误。我正在学习并且是 React js 的初学者。我正在学习 reactjs 中的映射,当我运行我的应用程序时出现此错误任何人都请解决这个问题。
文件系统分配如下。
【问题讨论】:
标签: javascript reactjs npm mapping jsx