Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The "path" argument must be of type string. Received undefined. not sure why?

I am trying to run my react project and I keep getting this error. I have reinstalled node and npm, and still this issue persists. wondering what to do next!

Enclosed, is package.json, hope it will shed some light.

I copied from my github repository the project that was there and I was still getting this error.

{
  "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)
like image 503
user8000626 Avatar asked Mar 03 '23 13:03

user8000626


1 Answers

I received this exact error from eslint while running node 10.0

After investigating the call stack, I found a dependency was using a nodejs path module parameter that was only introduced in nodejs 10.10. I was going to open an issue but I checked the eslint documentation and sure enough Node.js (^10.12.0, or >=12.0.0) is specified.

I suggest you check your Node.js version and upgrade to at least 10.10

like image 148
Tyler Johnson Avatar answered Mar 05 '23 14:03

Tyler Johnson