在gh页上部署create-react-app

时间:2018-07-31 16:21:51

标签: github-pages create-react-app

这是有据可查的,我已经非常仔细地遵循了几次说明。 但是,每次我在完全原始的create-react-app安装上运行“ npm run deploy”命令时,在我的系统上都会失败,并显示以下错误:-

  

C:\ React \ weather-app> npm运行deploy

     
    

weather-app@0.1.0预部署C:\ React \ weather-app     npm运行构建

  
     

npm WARN无效的配置loglevel =“ notice”

     
    

weather-app@0.1.0构建C:\ React \ weather-app     反应脚本构建

  
     

创建优化的生产版本...已成功编译。

     

gzip后的文件大小:

     

37.45 KB build \ static \ js \ main.9959b426.js 224 B build \ static \ css \ main.e94ed898.css

     

该项目是在假定驻留在/ weather-app /下构建的。您可以   通过package.json中的homepage字段控制此操作。

     

构建文件夹已准备好进行部署。要发布在   https://my-github-username.github.io/weather-app,运行:

     

npm运行部署

     

在此处了解有关部署的更多信息:

     

https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#deployment

     
    

weather-app@0.1.0部署C:\ React \ weather-app     gh-pages -d构建

  
     

错误:无法生成sh:没有此类文件或目录致命:无法   叉子

     

npm错误!代码ELIFECYCLE npm ERR! errno 1 npm错误! weather-app@0.1.0   部署:gh-pages -d build npm错误!退出状态1 npm ERR! npm ERR!   在weather-app@0.1.0部署脚本上失败。 npm ERR!这是   npm可能不是问题。可能还有其他日志记录   上面的输出。

     

npm错误!有关此运行的完整日志,请参见:npm ERR!
  C:\ Users \ matt \ AppData \ Roaming \ npm-cache_logs \ 2018-07-31T16_10_08_763Z-debug.log

这让我发疯,请任何人给我任何有关我的本地节点出了什么问题的指针,以防止该脚本运行?

1 个答案:

答案 0 :(得分:0)

我有同样的问题!但是我认为至少暂时没有找到工作。

  1. 使用A = ['nine'] B = ['three','six'] C = ['eleven'] 或失败的npm run build进行生产构建
  2. 然后运行应该运行npm run deploy的gh-page脚本

祝你好运!

相关问题