P粉1419251812023-08-17 13:27:15
Looks like you didn't define the task in package.json
(check it yourself). Since you are using React, make sure you have installed the gh-pages
npm package
npm install gh-pages --save-dev
In addition, you also need to define tasks under the scripts
object in the package.json
file:
"predeploy": "npm run build", "deploy": "gh-pages -d build",
For example, one of my github pages React applications has the following content:
"scripts": { "predeploy": "npm run build", "deploy": "gh-pages -d build", "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" },
Follow the instructions for a more detailed answer: https://github.com/gitname/react-gh-pages