gpt4 book ai didi

reactjs -/bin/sh : SET: command not found

转载 作者:行者123 更新时间:2023-12-05 08:50:52 24 4
gpt4 key购买 nike

我克隆了一个包含以下 package.json 的 React 项目。在 yarn 之后,yarn start 给了我以下错误。我试过 yarn add react-scripts start,但还是不行。

我正在使用 MacOS。

有人能帮忙吗?

$ yarn start
yarn run v1.21.1
$ SET PORT=8000 && react-scripts start
/bin/sh: SET: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

package.json:

{
"name": "frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.9.8",
"@microsoft/office-js-helpers": "^1.0.2",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"@types/react-stripe-elements": "^6.0.4",
"@uifabric/react-cards": "^0.109.49",
"axios": "^0.19.2",
"color": "^3.1.2",
"cross-storage": "^1.0.0",
"dva": "^2.4.1",
"dva-model-creator": "^0.4.3",
"formik": "^2.1.4",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"monaco-editor": "^0.20.0",
"node-sass": "^4.13.1",
"office-ui-fabric-react": "^7.105.4",
"query-string": "^6.11.1",
"react": "^16.13.1",
"react-app-polyfill": "^1.0.6",
"react-dom": "^16.13.1",
"react-monaco-editor": "^0.35.0",
"react-scripts": "3.4.1",
"react-stripe-elements": "^6.1.1",
"redux-devtools-extension": "^2.13.8",
"styled-components": "^5.0.1",
"typescript": "^3.8.3",
"yup": "^0.28.3"
},
"scripts": {
"start": "SET PORT=8000 && react-scripts start",
"build": "react-scripts --max_old_space_size=8096 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": {
"@types/color": "^3.0.1",
"@types/cross-storage": "^0.8.29",
"@types/jest": "^25.1.4",
"@types/lodash": "^4.14.149",
"@types/node": "^13.9.5",
"@types/query-string": "^6.3.0",
"@types/react": "^16.9.27",
"@types/react-dom": "^16.9.5",
"@types/react-redux": "^7.1.7",
"@types/styled-components": "^5.0.1",
"@types/yup": "^0.26.33"
}
}

最佳答案

在 Posixes 上,最兼容的是 "env PORT=8000 react-scripts start"

这就是为什么 cross-env包存在;它在 Windows 和 Posix 系统上都能正常工作。

关于reactjs -/bin/sh : SET: command not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61096051/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com