create-react-app编译失败,但进程不会退出

发布时间:2020-07-07 17:48

我有一个用create-react-app制作的应用程序,但有一个奇怪的问题,即在发生错误时脚本不会退出,本质上是:

~/my-project$ ./node_modules/.bin/react-scripts build
Creating an optimized production build...
Failed to compile.

./src/library/index.ts
Cannot find file './ApiClient.generated' in './src/library'.


I can continue typing into my terminal 

存在文件后,我可以正确地构建和编译项目。

~/my-project$ node -v
v14.5.0
~/my-project$ npm -v
6.14.5
~/my-project$ lsb_release -a 
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal

有人有什么想法吗?

回答1

该数字表明我在发布this comment之后立即找到答案,表明这是node-sass的问题。用sass替换它可以解决此问题。