我尝试将我的React Web应用程序部署到github页面,但是当我无法在线找到网站时
在控制台中,它表示应用程序已准备就绪,可以发布了,我应该运行命令npm run deploy
,但是每次运行该命令时,都会看到相同的消息
这是package.json
文件:
{
"name": "weather-app",
"version": "0.1.0",
"private": true,
"homepage": "http://shotiko-forecast.github.io/weather",
"dependencies": {
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-redux": "^7.1.3",
"react-scripts": "1.1.4",
"redux": "^4.0.4",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
答案 0 :(得分:0)
True
print (sum(x.startswith('aa') for x in df['something'].unique()))
3
> npm i gh-pages
"homepage": "https://username.github.io/repo-name",
"scripts": {
"deploy": "gh-pages -d build"
}
npm run build
答案 1 :(得分:0)
你的 React 应用的名称是 weather-app。我假设该应用程序的 github 存储库被命名为 weather-app。您的 package.json 文件中存在错误。主页属性设置不正确。 它应该设置为,
"homepage": "http://<<github-user-name>>.github.io/<<github-repo-name>>"
在您的情况下,将天气更改为天气应用程序,一切正常