gh-pages -d生成给出错误“文件";参数必须是非空字符串 [英] gh-pages -d build gives Error "file" argument must be a non-empty string

查看:83
本文介绍了gh-pages -d生成给出错误“文件";参数必须是非空字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我包括了在github上部署我的create react应用程序的所有步骤. 我的package.json的代码段

"scripts": {
    "start": "node scripts/start.js",
    "build": "node scripts/build.js",`enter code here`
    "test": "node scripts/test.js",
    "homepage": "http://myName.github.io/create-react-wars",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
},

这是我得到的错误

 gh-pages -d build
 

 "file" argument must be a non-empty string
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-star-wars@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-star-wars@0.1.0 deploy 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!     C:\Users\Jishu\AppData\Roaming\npm-cache\_logs\2019-08-02T17_13_43_435Z-debug.log
 

解决方案

遇到了同样的问题;这个答案解决了我的问题: https://stackoverflow.com/a/57315930/11879312

似乎像gh-pages 2.1中的错误.我通过将gh-pages降级到2.0版来解决了我的问题:yarn add gh-pages@2.0 -D或npm install gh-pages@2.0 --dev."

I included all the steps for deploying my create react app on github. snippet of my package.json

"scripts": {
    "start": "node scripts/start.js",
    "build": "node scripts/build.js",`enter code here`
    "test": "node scripts/test.js",
    "homepage": "http://myName.github.io/create-react-wars",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build"
},

this is the error i am getting

gh-pages -d build

"file" argument must be a non-empty string
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-star-wars@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-star-wars@0.1.0 deploy 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!     C:\Users\Jishu\AppData\Roaming\npm-cache\_logs\2019-08-02T17_13_43_435Z-debug.log

解决方案

Got the same issue; this answer solved my problem: https://stackoverflow.com/a/57315930/11879312

"Seems like a bug in gh-pages 2.1. I solved mine by downgrading gh-pages to version 2.0: yarn add gh-pages@2.0 -D or npm install gh-pages@2.0 --dev."

这篇关于gh-pages -d生成给出错误“文件";参数必须是非空字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆