在我的package.json中,我有类似的内容:
{
"name": "intercom",
"homepage": "https://{myGitHubUsername}.github.io/intercom",
"version": "0.1.0",
"private": true,
"dependencies": {
"antd": "^4.1.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.1.2",
"react-scripts": "3.4.1",
"uuid": "^7.0.3"
},
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -b master -d build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"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"
]
},
"devDependencies": {
"gh-pages": "^2.2.0"
}
}
我先运行npm run redeploy
,然后运行npm run deploy
,结果是:
$ npm run deploy
npm WARN npm npm does not support Node.js v12.15.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/
> intercom@0.1.0 predeploy C:\Projects\intercom-github
> npm run build
npm WARN npm npm does not support Node.js v12.15.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
npm WARN npm You can find the latest version at https://nodejs.org/
> intercom@0.1.0 build C:\Projects\intercom-github
> react-scripts build
Creating an optimized production build...
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
File sizes after gzip:
262.34 KB build\static\js\2.b803f0ee.chunk.js
61.62 KB build\static\css\2.ad8fe80d.chunk.css
2.2 KB build\static\js\main.2ff0dfce.chunk.js
772 B build\static\js\runtime-main.0ce6bcb6.js
582 B build\static\css\main.6cd79601.chunk.css
The project was built assuming it is hosted at /intercom/.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
Find out more about deployment here:
bit.ly/CRA-deploy
> intercom@0.1.0 deploy C:\Projects\intercom-github
> gh-pages -b master -d build
Published
所以它似乎可行,但是当我在浏览器中导航到https:// {myGitHubUsername} .github.io / intercom时,我得到了404此处没有GitHub Pages站点。
有什么想法吗?