![](/img/trans.png)
[英]"Failed to Compile" "Parsing error: Unexpected token :" during attempt to migrate to typescript in existing create-react-app
[英]create-react-app failed to compile, but process won't exit
我有一個使用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
有沒有人有任何想法?
它認為我會在我發布此評論后找到答案,表明這是node-sass
的問題。 用sass
替換它可以解決問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.