node环境是14.17.0,运行以前的项目(react16的版本)是可以正常运行的,就是创建新的项目不可以,会报错。
node环境是14.17.0,运行以前的项目(react16的版本)是可以正常运行的,就是创建新的项目不可以,会报错。
解决了。是现在react17版本创建项目的时候和AMD处理器的电脑有冲突好像。换了个package. json,把该降级的都降级就可以了。{ "name": "react-task-tracker", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "json-server": "^0.16.3", "react": "^17.0.1", "react-dom": "^17.0.1", "react-icons": "^4.1.0", "react-router-dom": "^5.2.0", "react-scripts": "4.0.1", "web-vitals": "^0.2.4" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "server": "json-server --watch db.json --port 5000" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }