记录一个最近遇到的问题:
在服务器部署React前端项目的时候,报错如题:
Error: Cannot find module 'react/lib/getNextDebugID'
本地运行的时候虽然也会报这个错,但是程序能够跑起来。(本地永远是这么神奇)但是服务器上就比较任性了,有报错就启动不了。
google下发现可以通过:
yarn add react-dom && npm install
解决。
于是实践了下,yarn又报错:
The engine "node" is incompatible with this module.
(哪那么容易?掀桌)
然后看到了这个。
试一下命令:
yarn --ignore-engines
唉哟~好了。
amazing~