“TypeError: Path must be a string” after break from project

I updated packages and all seemed fine. I took a week break from the project, ran npm install and cannot seem to figure out the cause of this error. It’s on this repo.

For convenience here is the error message and specs:

ERROR in ./src/app.js
Module build failed: TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.extname (path.js:1429:5)
    at processText (/home/kingscott/newton/node_modules/standard/node_modules/eslint/lib/cli-engine.js:144:30)
    at CLIEngine.executeOnText (/home/kingscott/newton/node_modules/standard/node_modules/eslint/lib/cli-engine.js:671:26)
    at Linter.lintText (/home/kingscott/newton/node_modules/standard-engine/index.js:65:59)
    at Object.standardLoader (/home/kingscott/newton/node_modules/standard-loader/index.js:19:12)
 @ multi app

and my packages:

"dependencies": {
    "material-ui": "^0.15.0-alpha.2",
    "react": "^15.0.2",
    "react-dom": "^15.0.2",
    "react-tap-event-plugin": "^1.0.0",
    "recompose": "^0.17.0"
  },
  "engines": {
    "node": "0.12.7"
  },
  "devDependencies": {
    "babel": "^5.8.21",
    "babel-core": "^5.8.22",
    "babel-loader": "^5.3.2",
    "standard": "^6.0.8",
    "standard-loader": "^3.0.0",
    "webpack": "^1.13.0",
    "webpack-dev-server": "^1.14.1"
  }

If you check out the repo, you can see my server.js and webpack.config.js.

Thanks.

Author: Fantashit

9 thoughts on ““TypeError: Path must be a string” after break from project

  1. Must be a node problem. Downgraded to node 5.11.1 and it works. Thanks for the help, you can close.

    👍

  2. Webpack update was the perfect solution for this issue. I’d like just to add a comment on how to update the npm packages easier. You’d need to run the following three commands in your project’s root directory:

    npm i -g npm-check-updates
    npm-check-updates -u
    npm install

  3. i meet the same question

    ➜  ~ node -v
    v8.1.0
    ➜  ~ npm -v
    5.0.4
    

    the error message

    ERROR in ./app/index.js
    Module build failed: TypeError: Path must be a string. Received undefined
    

    and i update my babel-core version to 6.11.4, it`s work well
    @yorkie Great! It helps me.

  4. I got it working now after using ncu (npm-check-updates) to fetch the latest versions:

    react-redux          ^5.0.5  →  ^5.0.6
    eslint-plugin-react  ^7.1.0  →  ^7.2.0
    webpack              ^3.5.1  →  ^3.5.2
    webpack-dev-server   ^2.7.0  →  ^2.7.1
    

    Node: v8.2.1
    NPM: 5.3.0

Comments are closed.