React 脚本无法编译

ket*_*tim 5 node.js npm github-pages reactjs

我找到了一堆有些相关的答案,但到目前为止似乎无法修复......

对 React 有点陌生(而且我很累),所以没有任何线索 - 我使用 create-react-app 创建了一个新的 React 应用程序,然后在 package.json 中添加了 Github Pages

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! cintacks@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cintacks@0.1.0 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! cintacks@0.1.0 predeploy: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cintacks@0.1.0 predeploy script
Run Code Online (Sandbox Code Playgroud)

Tra*_*itu 0

鉴于目前的情况,我会尝试:

  • 检验/Users/Mac/.npm/_logs/2017-06-14T19_52_07_541Z-debug.log
  • 重新安装create-react-app
  • 运行npm start和/或npm run build不添加 GitHub 页面位

还:

  • 你不应该跑步吗npm run deploy
  • 看一眼/Users/Mac/Sites/cintacks/srcreact里面有一个叫的文件夹吗?