npm 無法安裝 craco


用 CRA TypeScript 建立一個模板,加上 antd 之後要客製化風格就採用 craco 發現 npm i @craco/craco 會失敗,噴 error
npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: antd-demo-ts@0.1.0 npm ERR! Found: react-scripts@5.0.1 npm ERR! node_modules/react-scripts npm ERR! react-scripts@"5.0.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react-scripts@"^4.0.0" from @craco/craco@6.4.5 npm ERR! node_modules/@craco/craco npm ERR! @craco/craco@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
改用 npm i @craco/craco@alpha就正常了

#npm #TypeScript #ts #nodejs #js #antd #craco #React #reactjs #Node






你可能感興趣的文章

專案經理課程筆記

專案經理課程筆記

Caffe & GoogLeNet,怎麼幫助機器人更好地辨識物體

Caffe & GoogLeNet,怎麼幫助機器人更好地辨識物體

理解與解決 N + 1 problem

理解與解決 N + 1 problem






留言討論