Reputation: 127
I am working on a big project and I cannot run it anymore because of this error:
When I run npm run serve
ERROR TypeError: Cannot read property 'NormalModule' of undefined
TypeError: Cannot read property 'NormalModule' of undefined
at VueLoaderPlugin.apply (/Users/<user>/muso-ninjas/node_modules/vue-loader-v16/dist/pluginWebpack5.js:44:47)
at webpack (/Users/<user>/muso-ninjas/node_modules/@vue/cli-service/node_modules/webpack/lib/webpack.js:51:13)
at serve (/Users/<user>/muso-ninjas/node_modules/@vue/cli-service/lib/commands/serve.js:163:22)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Please help me because I am stuck and I would like to go with my project.
Upvotes: 9
Views: 15759
Reputation: 1
I decided to use yarn to install the dependencies, and it worked like magic. I was amazed. Here are the steps:
First, download and install yarn
npm install -g yarn
Then, use this command to install the dependencies
yarn install
After that, you can run it with npm or yarn.
npm run serve
And that's it! Do try it.
Upvotes: 0
Reputation: 41
1 yarn remove webpack 2 yarn add webpack. // the problem is the webpack version, so by installing the last version everything works as before.
Upvotes: -1
Reputation: 153
As suggested in link from the first comment, I deleted node_modules, replaced the node-sass in package.json with "sass": "^1.26.5" and ran npm install but it didn't work.
Then I repeated the steps and removed package-lock.json as well.
This helped and the app was served properly
Upvotes: 1
Reputation: 56853
Try this first:
npm install
. Maybe someone else on your project has changed/added a dependency, and pulling from your git repo got you the code that relies on this, but won't get you the dependency itself.If that doesn't fix your issue, try this:
node_modules
folder in your project root.node -v
in the terminal.npm
: Run npm i -g npm
in the terminal.npm -v
in the terminal.npm install
in your project's root folder.If this doesn't fix your issue, you need to find help from someone else on your team.
Upvotes: 4