小编jen*_*lky的帖子

部署时找不到 git-upload-pack

当我尝试将我的 React 应用程序部署到 github 页面时,我运行了npm run deploy. 它设法构建但在部署时出现以下错误:

git-upload-pack '.': git-upload-pack: command not found
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.
Run Code Online (Sandbox Code Playgroud)

我的git remote -v回报:

origin  https://github.com/helplah/shopping-cart.git (fetch)
origin  https://github.com/helplah/shopping-cart.git (push)
Run Code Online (Sandbox Code Playgroud)

git github-pages

5
推荐指数
1
解决办法
3102
查看次数

React-router 如何重定向到服务器端口

嗨,我正在使用 react router v4。

我的 React 在端口 3000 上运行,而 express 服务器在端口 8080 上运行。下面代码的重定向部分将我带到localhost:3000/http://localhost:8080/auth/login.

我已经"proxy": "localhost:8080"在我的 React 的 package.json 中了。它不起作用。

我怎样才能从 重定向localhost:3000localhost:8080/auth/login

应用程序.js

class App extends Component {
  constructor(props) {
    super(props);
    this.props.fetchProducts();
    this.props.fetchUser();
  }

  render() {
    return (
      <Switch> 
        <Route exact path='/cart' render={() => this.props.isLoggedIn ? 
          <Checkout /> : 
          <Redirect to='http://localhost:8080/auth/login' /> 
        } />
        <Route exact path='/user/account/profile' render={() => <Profile />} />
        <Route exact path='/' render={() => <MainPage />} />
      </Switch>
    );
  } …
Run Code Online (Sandbox Code Playgroud)

reactjs react-router

5
推荐指数
1
解决办法
5975
查看次数

标签 统计

git ×1

github-pages ×1

react-router ×1

reactjs ×1