在 Ubuntu Server 20.04 上使用以下安装:
sudo apt-get update
sudo apt-get install nodejs
sudo apt install python2
sudo apt install npm
npm install ganache-cli
npm install node-gyp@3.6.2
npm install truffle@5.1.39
sudo npm install create-react-app@3.3.1 -global
npm install
我遇到错误无法加载资源:net::ERR_CONNECTION_REFUSED 127.0.0.1:8545/:1
我正在使用命令行界面运行 ganache:
我可以通过节点命令提示符测试连接
然后我在 React 中尝试 App.js
我尝试了以下方法:
1.) Setting up a proxy under package.json : http://127.0.0.1:8545
2.) Trying http://0.0.0.0:8545
3.) Setting up a middleware proxy account as presented in the following solution:
https://medium.com/bb-tutorials-and-thoughts/react-how-to-proxy-to-backend-server-5588a9e0347
"proxy": "http://127.0.0.1:8545"
4.) addressing cache related issues through rm -r package-lock.json node_modules and npm install updating react.js to latest version
5.) trying different port: 7545
6.) updating react to latest version on ubuntu