gpt4 book ai didi

reactjs - react 应用程序 : Why I get an error when I try to run npm start script?

转载 作者:行者123 更新时间:2023-12-03 13:56:11 26 4
gpt4 key购买 nike

我安装了所有必需的软件包并尝试运行 npm start 脚本,这给了我以下错误:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:118:11)
at Object.join (path.js:375:7)
at noopServiceWorkerMiddleware (C:\Alex\Practise\React website\front-end\node_modules\react-dev-utils\noopServiceWorkerMiddleware.js:14:26)
at Layer.handle [as handle_request] (C:\Alex\Practise\React website\front-end\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (C:\Alex\Practise\React website\front-end\node_modules\express\lib\router\index.js:317:13)
at C:\Alex\Practise\React website\front-end\node_modules\express\lib\router\index.js:284:7
at Function.process_params (C:\Alex\Practise\React website\front-end\node_modules\express\lib\router\index.js:335:12)
at next (C:\Alex\Practise\React website\front-end\node_modules\express\lib\router\index.js:275:10)
at launchEditorMiddleware (C:\Alex\Practise\React website\front-end\node_modules\react-dev-utils\errorOverlayMiddleware.js:20:7)
at Layer.handle [as handle_request] (C:\Alex\Practise\React website\front-end\node_modules\express\lib\router\layer.js:95:5)

这是我的 package.json 的副本:

{
"name": "front-end",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"node-sass": "^4.13.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.3.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts 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"
]
}
}

我尝试删除并重新安装整个项目,重新安装节点和软件包,但没有成功。非常感谢任何帮助!

最佳答案

将您的 react-scripts 升级到 3.4.0。我刚刚安装了 package.json 提供的模块,并将 react-scripts 升级到最新版本,一切正常。

有关 github issue 的更多详细信息.

关于reactjs - react 应用程序 : Why I get an error when I try to run npm start script?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60243820/

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