我很久没有在我的React开发中看到这个了,想知道如何解决它?
我正在尝试做一个npm run build
,但它给我以下日志:
> tp@0.1.0 build
> react-scripts build
Creating an optimized production build...
(node:8780) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8780) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'find' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'head' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'set' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'test' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'to' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency
(node:8780) Warning: Accessing non-existent property 'which' of module exports inside circular dependency
Failed to compile.
Unknown browser query `dead`
甚至它都没有npm start
节点v17,所以我降级到了v16+ lts。有什么解决方案吗?
4条答案
按热度按时间kuuvgm7e1#
我遇到了完全相同的循环依赖错误,以下解决了错误:
将我的节点版本升级到最新版本
nvm install latest
并使用
yarn upgrade-interactive --latest
更新我的依赖项。祝好。
ha5z0ras2#
我尝试在Windows上安装最新的Node.js v17版本,但它甚至无法运行。
dsekswqp3#
这个问题已经被自动标记为过时,因为它没有任何最近的活动。如果没有发生任何进一步的活动,它将在5天后被关闭。
b4qexyjb4#
我在使用
create-react-app
创建的新项目中也收到了相同的警告。后来发现,由于某种原因,我使用的是相当旧的react-scripts
版本(0.9.5)。我将其升级到5.0.1后,这些警告消失了。