Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR TypeError: Cannot read property 'match' of undefined

npm run build gives

ERROR TypeError: Cannot read property 'match' of undefined.

-  Building for production...
 ERROR  TypeError: Cannot read property 'match' of undefined
TypeError: Cannot read property 'match' of undefined
    at VuetifyLoaderPlugin.apply (/usr/src/app/node_modules/vuetify-loader/lib/plugin.js:28:29)
    at webpack (/usr/src/app/node_modules/webpack/lib/webpack.js:51:13)
    at /usr/src/app/node_modules/@vue/cli-service/lib/commands/build/index.js:192:5
    at new Promise (<anonymous>)
    at build (/usr/src/app/node_modules/@vue/cli-service/lib/commands/build/index.js:191:10)
    at async /usr/src/app/node_modules/@vue/cli-service/lib/commands/build/index.js:88:7
npm ERR! code ELIFECYCLE
npm ERR! errno 1


Below is my package.json dependencies:
"dependencies": {
    "ag-grid-community": "^21.2.2",
    "ag-grid-vue": "^21.2.2",
    "axios": "^0.19.0",
    "core-js": "^2.6.10",
    "csvjson": "^5.1.0",
    "date-fns": "^2.7.0",
    "fabric": "^3.5.0",
    "jquery": "^3.4.1",
    "lodash": "^4.17.15",
    "moment": "^2.24.0",
    "stylus": "^0.54.7",
    "stylus-loader": "^3.0.2",
    "vue": "^2.6.10",
    "vue-property-decorator": "^8.3.0",
    "vue-router": "^3.0.3",
    "vue-session": "^1.0.0",
    "vuetify": "^2.1.9",
    "vuex": "^3.1.2"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.12.1",
    "@vue/cli-plugin-eslint": "^3.12.1",
    "@vue/cli-service": "^3.12.1",
    "@vue/test-utils": "^1.0.0-beta.29",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^24.9.0",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "expect": "^24.9.0",
    "jest": "^24.9.0",
    "jest-transform-stub": "^2.0.0",
    "jsdom": "^15.2.1",
    "jsdom-global": "^3.0.2",
    "mocha": "^6.2.2",
    "mocha-webpack": "^1.1.0",
    "node-sass": "^4.13.0",
    "sass": "^1.23.6",
    "sass-loader": "^7.1.0",
    "vue-cli-plugin-vuetify": "^0.6.3",
    "vue-jest": "^3.0.5",
    "vue-template-compiler": "^2.6.10",
    "vuetify-loader": "^1.3.1",
    "webpack-node-externals": "^1.7.2"
  }

npm build fails saying 'match' of undefined. I gave the error details and the package.json file...

FYI, I tried to remove the package-lock.json & node_nodules then gave install and build. but still its not working.

  • node : v11.12.0
  • npm: 6.11.3
like image 454
Sathya Narayan C Avatar asked Nov 23 '19 09:11

Sathya Narayan C


2 Answers

  1. clear npm cache
  2. delete package-lock.json.

    npm cache clear --force

and try to run the command:

rm -rf node_modules
rm package-lock.json
npm cache clear --force
npm install
like image 68
Angella Yu Avatar answered Nov 11 '22 23:11

Angella Yu


This is a recent bug in the vuetify-loader (see issue #101). The bug has already been fixed and you can temporarily fix this manually by changing the following file.

node_modules/vuetify-loader/lib/plugin.js at row #6

See change:

- this.options = options
+ this.options = options || {}
like image 34
Justin Avatar answered Nov 11 '22 22:11

Justin