我是一个初学者的React,我有问题,我不知道他们甚至出现在一个React项目,我一直在玩。
显然,我假设这个错误是与React路由器包,但我不知道它是怎么来的,我如何可以修复它,所以任何帮助将是伟大的。
Compiled with warnings.
Failed to parse source map from '/Users/X/crm/packages/react-router-dom/index.tsx' file: Error: ENOENT: no such file or directory, open '/Users/X/crm/packages/react-router-dom/index.tsx'
Failed to parse source map from '/Users/X/crm/packages/react-router/index.tsx' file: Error: ENOENT: no such file or directory, open '/Users/X/crm/packages/react-router/index.tsx'
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
WARNING in ./node_modules/react-router-dom/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/X/crm/packages/react-router-dom/index.tsx' file: Error: ENOENT: no such file or directory, open '/Users/X/crm/packages/react-router-dom/index.tsx'
WARNING in ./node_modules/react-router/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/Users/X/crm/packages/react-router/index.tsx' file: Error: ENOENT: no such file or directory, open '/Users/X/crm/packages/react-router/index.tsx'
webpack compiled with 2 warnings
非常感谢!
我已尝试运行应用程序,预期它会运行,但出现了错误消息。
1条答案
按热度按时间ffscu2ro1#
您可能不止一次更改了React-Router-Dom的版本。它基本上发生在您更改任何版本或React-Router-dom或React-Router时。文件路径不匹配,并与index.js一起保存。
你可以一次检查你的路径文件,例如:your_path_file\packages\react-router\index.tsx'它将被替换。此外,您会在node_modules中收到一个警告,指出您的文件丢失,因为节点模块已经为您添加了该文件,并且一旦您更改了React-Router-Dom版本,名称就会更改。