Getting build error after using npm audit fix –force to fix audit issues

I had 18 vulnerabilities (7 low, 9 moderate, 2 high) in npm audit report and after a day of using npm audit fix and trying to install individual package with npm install $package_name I decided to use npm audit fix --force. I am getting the following error while trying to run npm start after that. How to resolve this?

I am building a blog with help of vue (I am java/python developer and new to javascript and node, please let me know if I need to provide any adiitional project set-up details)

[email protected] start
> npm run dev


> [email protected] dev
> node build/dev-server.js

/****/working/the-doof-media-ui/node_modules/webpack/node_modules/schema-utils/dist/validate.js:104
    throw new _ValidationError.default(errors, schema, configuration);
    ^

ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration.devtool should match pattern "^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$".
   BREAKING CHANGE since webpack 5: The devtool option is more strict.
   Please strictly follow the order of the keywords in the pattern.
    at validate (/****/working/the-doof-media-ui/node_modules/webpack/node_modules/schema-utils/dist/validate.js:104:11)
    at validateSchema (/****/working/the-doof-media-ui/node_modules/webpack/lib/validateSchema.js:79:2)
    at create (/****/working/the-doof-media-ui/node_modules/webpack/lib/webpack.js:105:4)
    at webpack (/****/working/the-doof-media-ui/node_modules/webpack/lib/webpack.js:142:32)
    at f (/media/karthik/Data2/dev/theDoofMedia/working/the-doof-media-ui/node_modules/webpack/lib/index.js:54:15)
    at Object.<anonymous> (/****/working/the-doof-media-ui/build/dev-server.js:25:18)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  errors: [
    {
      keyword: 'anyOf',
      dataPath: '.devtool',
      schemaPath: '#/definitions/DevTool/anyOf',
      params: {},
      message: 'should match some schema in anyOf',
      schema: [
        { enum: [ false, 'eval' ] },
        {
          type: 'string',
          pattern: '^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$'
        }
      ],
      parentSchema: {
        description: 'A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).',
        anyOf: [
          { enum: [Array] },
          {
            type: 'string',
            pattern: '^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$'
          }
        ]
      },
      data: '#cheap-module-eval-source-map',
      children: [
        {
          keyword: 'enum',
          dataPath: '.devtool',
          schemaPath: '#/definitions/DevTool/anyOf/0/enum',
          params: { allowedValues: [Array] },
          message: 'should be equal to one of the allowed values',
          schema: [ false, 'eval' ],
          parentSchema: { enum: [Array] },
          data: '#cheap-module-eval-source-map',
          children: undefined
        },
        {
          keyword: 'pattern',
          dataPath: '.devtool',
          schemaPath: '#/definitions/DevTool/anyOf/1/pattern',
          params: {
            pattern: '^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$'
          },
          message: 'should match pattern "^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$"',
          schema: '^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$',
          parentSchema: {
            type: 'string',
            pattern: '^(inline-|hidden-|eval-)?(nosources-)?(cheap-(module-)?)?source-map$'
          },
          data: '#cheap-module-eval-source-map',
          children: undefined
        }
      ]
    }
  ],
  schema: {
    definitions: {
      Amd: {
        description: 'Set the value of `require.amd` and `define.amd`. Or disable AMD support.',
        anyOf: [
          {
            description: 'You can pass `false` to disable AMD support.',
            enum: [Array]
          },
          {
            description: 'You can pass an object to set the value of `require.amd` and `define.amd`.',
            type: 'object'
          }
        ]
      },

....

Also, I am getting

/the-doof-media-ui/build/webpack.prod.conf.js:34
    new webpack.optimize.UglifyJsPlugin({
    ^

TypeError: webpack.optimize.UglifyJsPlugin is not a constructor
    at Object.<anonymous> (/media/karthik/Data2/dev/theDoofMedia/working/the-doof-media-ui/build/webpack.prod.conf.js:34:5)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/media/karthik/Data2/dev/theDoofMedia/working/the-doof-media-ui/build/build.js:17:23)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

If I run npm run build

Answer

remove the node_modueles folder and run

npm install