gpt4 book ai didi

node.js - "path"参数必须是字符串类型。收到未定义。不知道为什么?

转载 作者:行者123 更新时间:2023-12-03 23:48:05 31 4
gpt4 key购买 nike

我正在尝试运行我的 react 项目,但我不断收到此错误。
我已经重新安装了node和npm,但这个问题仍然存在。
想知道下一步该怎么做!

附上,是 package.json,希望它会有所启发。

我从我的 github 存储库中复制了那里的项目,但我仍然收到此错误。

{
"name": "our-family-client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@blueprintjs/core": "^3.22.3",
"bootstrap": "^4.3.1",
"react": "^16.11.0",
"react-autosuggest": "^9.4.3",
"react-bootstrap": "^1.0.0-beta.14",
"react-dom": "^16.11.0",
"react-grid-gallery": "^0.5.5",
"react-redux": "^7.1.1",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.4.1",
"reactstrap": "^8.1.1",
"redux": "^4.0.4",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "mocha",
"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": {
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^1.13.0",
"chai": "^4.2.0",
"mocha": "^7.0.0",
"noop-service-worker-middleware": "^3.0.0"
}
}


TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:117:11)
at Object.join (path.js:1039:7)
at noopServiceWorkerMiddleware (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/react-dev-utils/noopServiceWorkerMiddleware.js:14:26)
at Layer.handle [as handle_request] (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/index.js:317:13)
at /Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/index.js:335:12)
at next (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/index.js:275:10)
at launchEditorMiddleware (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/react-dev-utils/errorOverlayMiddleware.js:20:7)
at Layer.handle [as handle_request] (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/index.js:317:13)
at /Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/index.js:335:12)
at next (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/index.js:275:10)
at handleWebpackInternalMiddleware (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/react-dev-utils/evalSourceMapMiddleware.js:42:7)
at Layer.handle [as handle_request] (/Users/saraginsburg/FlatIron/our-family/our-family-frontend/node_modules/express/lib/router/layer.js:95:5)

最佳答案

我在运行 Node 10.0 时从 eslint 收到了这个确切的错误

在调查调用堆栈后,我发现一个依赖项正在使用 nodejs 路径模块 parameter这仅在 nodejs 10.10 中引入。
我打算打开一个问题,但我检查了 eslint 文档,果然 Node.js (^10.12.0, or >=12.0.0)被指定。

我建议你检查你的 Node.js 版本并至少升级到 10.10

关于node.js - "path"参数必须是字符串类型。收到未定义。不知道为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61354145/

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