Vue.js 2.3.2 version mismatch - npm

After running npm run watch in terminal on my php laravel project I got this error:
Module build failed: Error:
Vue packages version mismatch:
- vue#2.3.2
- vue-template-compiler#2.2.6
This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader#>=10.0, simply update vue-template-compiler.
If you are using vue-loader#<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.
I tried to run this command npm update vue-template-compiler but the error remained.
Did somebody else meet with this problem?

I found the soluiton, I had to delete the node_modules folder, after I had to run npm install then the problem is solved.

Related

Cannot find module ‘#expo/metro-config’ when trying to start the project with expo cli >= 4.8.0

I recently tried to launch my project on a new computer. I downloaded the source code from its repository and ran npm install to get all the needed packages.
However, when I run npm start or expo start:web, I get the error:
Cannot find module '#expo/metro-config'
I ran npm install #expo/metro-config and the install run without issue, but I still get the “Cannot find module '#expo/metro-config'” error.
The only post I saw regarding this error recommends editing the metro.config.js but I do not use one.
I am on SDK 42, and the project launches fine on my other computer. Any idea what is happening?
FYI, I use to perform this whole operation without any issue until now.
UPDATE:
I ran npm install -g #expo/metro-config and now I get the error Cannot find module 'resolve-from'
So it looks like maybe running npm install -g expo-cli doesn't actually install all the necessary packages? Could it be the issue?
I managed to make it "work" (get other missing packages errors down the line) by reverting to expo-cli 4.7.3. Anything from 4.8.0 and above will cause the error.
Something else is that on a fresh npm install, after running npm install -g expo-cli, if I try to create a project with expo init, I will get the error Error: Cannot find module 'kleur'. Running npm install kleur fix it, but maybe that's also a clue.

Error : vue-loader requires #vue/compiler-sfc to be present in the dependency tree

I'm getting this error when I'm trying to do
npm run serve
I have tried npm update sudo npm serve. It didn't work.
I also tried deleting the package-lock.json file and doing npm install after that, and that too didn't work. I also downgraded the version of the vue-loader to 15.9.2 and that also didn't work
Actually, you are missing the library so you just have to install it with
npm i #vue/compiler-sfc
This is a new thing in vue-loader#16. To fix this, assuming you are using Vue 2, you should downgrade:
yarn add vue-loader#15
Note that you also need vue-template-compiler, the same version as the version of Vue you are using.
For us, the ones using VueJs 2!
Remember vue-loader#16 is only for VueJs 3.
Check the releases log
here.
I downgrade to the v15.9.7. It is working fine.
If you are using Dependabot, can add the a ignore rule to avoid v16 PRs:
ignore:
- dependency-name: "vue-loader"
versions: ["16.x"]
you can do this and this works for me
vue-loader#15.9.7
vue-template-compiler#2.6.1
Most likely, your problem has already been solved in one of the previous answers. But there is another least likely option in which you will receive a similar error.
The problem is in... node / npm versions. Possibly, some (non-LTS?) node/npm versions generates not quite correct dependency tree, and then trying to build unnecessary sources.
We got this error in one of our projects, when Jenkins built it on node v11.14.0 and npm 6.7.0.
But same sources are built OK on node v8.16.0 / npm 6.4.1, node v10.18.0 / npm 6.13.4 and node v14.16.0 / npm 7.8.0. We had to update node and npm to fix this issue.
Please, use this answer only as a "last chance". No need to update/rollback your node/npm environment immediately when you see this error.
For those running into this with Vue 3 and Yarn Berry, keep in mind that Vue 3 plugins are still not compatible with Yarn 2.*, so you'd have to update vue-loader section in your .yarnrc.ymlas follows:
vue-loader#*:
peerDependencies:
'#vue/compiler-sfc': '*'
webpack: '*'
I get an error when I install it directly. but it worked when I forced it.;
npm i #vue/compiler-sfc --force
You can also solve it by the following steps:
npm update
then use
npm i #vue/compiler-sfc

Vue packages version mismatch with Laravel

I'm having this trouble and I need your help. Here's my package.json file
"dependencies": {
...
"vue": "^2.6.11",
"vue-template-compiler": "^2.6.11",
...
}
and when y execute npm install and I check for the vue and the vue-template-compiler packages in my node_modules folder there are both the same version (2.6.11). But here is my problem, when I load my site I have this error message:
Error: Module build failed: Error:
Vue packages version mismatch:
- vue#2.6.11
- vue-template-compiler#2.5.2
This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader#>=10.0, simply update vue-template-compiler.
If you are using vue-loader#<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.
So I checked the version of the vue-loader I have in my node_modules and its version is higher 10.0, so I executed npm update vue-template-compiler just as it says at the error message, but it not makes any changes (because in my node_modules folder I alredy have the correct version).
I checked the current version of vue-template-compiler in the NPMJS site and is 2.6.11, as like as the current vue version.
I tried delete the node_modules folder and re-install with npm install, I tried delete node_modules folder + package-lock.json file and re-install, I tried execute npm update and re-install, I deleted my browser's cache. I tried everything I found related with my problem, but nothing worked. So here I am, if anybody knows what could be happening please help, I don't know what to do anymore. I'm using Laravel 5.5.

angular-cli keeps throwing Error: Cannot find module 'source-map'

So I installed the angular-cli using npm install #angular-devkit/build-angular but every time I try and use the ng command I get this error: Error: Cannot find module 'source-map'
even trying ng version throws the error. I also trying installing it using npm install angualt-cli but that didnt work either. Anyone know how to fix this issue?
I tried a lot of things and ended up just giving up and running npm install source-map which solved it for me.

vue ui Error: Cannot find module 'core-js/proposals/array-flat-and-flat-map'

I'm starting to learn Vue.js but when I try to launch vue ui, I get this error:
Error: Cannot find module 'core-js/proposals/array-flat-and-flat-map'
I tried to npm install -g core-js and yet still the same error.
my npm version is 6.4.1
Thanks for your anwsers
Here's a temp workaround while they work on resolving the underlying issue:
npm install -g core-js#3.0.0-beta.11
That temp resolution comes from this GitHub issue:
https://github.com/vuejs/vue-cli/issues/3406#issuecomment-459956718