2

I am developing an application using Vuejs/Nuxtjs and I was using the "nuxt": "^2.2.0", and everything was working perfectly.

I was having some vulnerability issues in npm audit so I tried to fix them using the command npm audit fix --force during which Nuxt was updated to "nuxt": "^2.15.8",.

After this when I try to bring-up the application using the command npm run dev I get the error:

/Users/username/projects/projectName/node_modules/nuxt/dist/nuxt.js:3086
          return !modulesToTranspile.some(module => module.test(file))
                                                           ^

TypeError: module.test is not a function
    at /Users/username/projects/projectName/node_modules/nuxt/dist/nuxt.js:3086:60
    at Array.some (<anonymous>)
    at exclude (/Users/username/projects/projectName/node_modules/nuxt/dist/nuxt.js:3086:38)
    at Array.<anonymous> (/Users/username/projects/projectName/node_modules/webpack/lib/RuleSet.js:79:11)
    at Object.resource (/Users/username/projects/projectName/node_modules/webpack/lib/RuleSet.js:95:17)
    at RuleSet._run (/Users/username/projects/projectName/node_modules/webpack/lib/RuleSet.js:492:30)
    at RuleSet._run (/Users/username/projects/projectName/node_modules/webpack/lib/RuleSet.js:547:10)
    at RuleSet.exec (/Users/username/projects/projectName/node_modules/webpack/lib/RuleSet.js:475:8)
    at /Users/username/projects/projectName/node_modules/webpack/lib/NormalModuleFactory.js:270:34
    at /Users/username/projects/projectName/node_modules/neo-async/async.js:6883:13
    at /Users/username/projects/projectName/node_modules/webpack/lib/NormalModuleFactory.js:215:9
    at /Users/username/projects/projectName/node_modules/enhanced-resolve/lib/Resolver.js:180:13
    at /Users/username/projects/projectName/node_modules/enhanced-resolve/lib/Resolver.js:284:24
    at eval (eval at create (/Users/username/projects/projectName/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
    at /Users/username/projects/projectName/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:43:26
    at /Users/username/projects/projectName/node_modules/enhanced-resolve/lib/Resolver.js:284:24

I have not done any other changes to my project and if I try to replace "nuxt": "^2.2.0", again then everything works fine. Can someone please let me know what I need to do to fix this issue?

BATMAN_2008
  • 2,788
  • 3
  • 31
  • 98
  • Did you get a solution? I have same problem – tomoc4 Feb 16 '22 at 21:02
  • @tomoc4 Actually I never found the solution but I reverted the changes because `npm audit fix --force` will update the `Nuxt` which may break the program. Use only `npm audit fix`. Not sure if there is any other solution. – BATMAN_2008 Feb 17 '22 at 07:36

0 Answers0