我發現了一堆有點關係的答案,但似乎無法到目前爲止修復...陣營腳本編譯失敗
位新的反應(我tirrred),所以沒有任何線索 - 我使用create-react-app創建了一個新的React應用程序,然後根據here在package.json中添加Github頁面位。
在npm run build
它無法編譯。下面的錯誤。事情我已經嘗試:
- 刪除並重新安裝node_modules
- 結算NPM緩存
- 破壞,從頭
> react-scripts build
Creating an optimized production build...
Failed to compile.
Module not found: Error: Can't resolve 'react' in '/Users/Mac/Sites/cintacks/src'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Mac/.npm/_logs/2017-06-14T19_52_07_541Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] predeploy: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] predeploy script
錯誤日誌與我上面發佈的基本相同。我設法解決它...通過使用紗線而不是npm - 張貼爲答案。您絕對指出我正確的方向 - 謝謝! – kettultim