Аргумент "file" должен иметь тип string. Полученный тип не определен в npm run deploy to gh-pages - программирование

Аргумент "file" должен иметь тип string. Полученный тип не определен в npm run deploy to gh-pages

Я пытался развернуть реагирующее приложение на gh-страницах. Я делал это раньше, но это первый раз, когда я получаю такую ошибку. Там написано

Аргумент "file" должен иметь тип string. Полученный тип не определен

Я попытался удалить папку node_modules и переустановил все пакеты с помощью npm install, но все равно обнаружил ту же ошибку

Ниже мой файл package.json

{
      "name": "qrummy",
      "version": "0.1.0",
      "homepage": "https://quiph.github.io/QRummy/",
      "private": true,
      "dependencies": {
        "firebase": "^6.2.4",
        "gh-pages": "^2.1.0",
        "react": "^16.8.6",
        "react-dom": "^16.8.6",
        "react-scripts": "3.0.1"
      },
      "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test",
        "predeploy": "npm run build",
        "deploy": "gh-pages -d build",
        "eject": "react-scripts eject"
      },
      "eslintConfig": {
        "extends": "react-app"
      },
      "browserslist": {
        "production": [
          ">0.2%",
          "not dead",
          "not op_mini all"
        ],
        "development": [
          "last 1 chrome version",
          "last 1 firefox version",
          "last 1 safari version"
        ]
      }
    }

А это мой основной файл index.js

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';

ReactDOM.render(<App />, document.getElementById('root'));

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
serviceWorker.unregister();

Вывод ошибок следующий

 [email protected] deploy /home/qtalkdev/Krunal/github/QRummy
> gh-pages -d build

The "file" argument must be of type string. Received type undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy: 'gh-pages -d build'
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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!     /home/qtalkdev/.np'enter code here'm/_logs/2019-08-01T17_28_14_611Z-debug.log
4b9b3361

Ответ 1

Похоже, текущая версия не работает. Я столкнулся с той же проблемой сегодня. Удалите модуль gh-pages. Установил версию 2.0.1 и все заработало.