Which version of Webpack to use? - npm

Right now, the default version of Webpack installed with an npm install is is 1.14.0. Should i be using version 2 of Webpack?

Related

how to downgrade vue version from 3 to 2

I am using Vue3 for studying but it cannot support Vuetify library. So I need to downgrade it to version 2. How can I do that?
Vue3 is not installed in global. And vue-cli is installed in global, which is version 4.5.15.
You can use
npm install <package>#<version>
However, if you have components you have to update their code also.
1 INSTALL VUE JS 2
npm install vue#2.x.x
2 UPDATE YOUR VUE-LOADER
npm update vue-loader
3 if it is not installed, install it
npm i vue-loader
4 install vue/compiler-sfc
npm add vue#next
npm add #vue/compiler-sfc -D

How to check my create-nuxt-app version and upgrade it?

Background:
Previously, running yarn create nuxt-app myApp installs Nuxt v2.4.0 but today for example I noticed you downgraded to Nuxt v2.0.0. I did not change the development environment so I can not understand this behavior.
I did some search and complained elsewhere when I landed on this:
So the OP was asked to upgrade his create-nuxt-app version.
Question:
But how to do that ? How to check which create-nuxt-app I do have ?
Bonus:
I read why does Create-Nuxt-App installs nuxt version 1.4.5? and the answer says you: "Make sure you don't have a version of create-nuxt-app installed locally or globally." But how do you even install create-nuxt-app locally and globally ?
Info:
When I run npm list -g | grep 'nuxt-app' I do not get anything.
You are fine. You don't need to do anything.
If you create a project with create-nuxt-app you get "nuxt": "^2.0.0" in your package.json which means that your project automatically uses the latest 2.x.x version of nuxt. Also if there'll be an update to nuxt your project with update itself.
And to answer your two questions:
If you have create-nuxt-app installed in your project you can check its version using npm list create-nuxt-app (make sure you are in the project's directory). If it's installed globally you can check the version using npm list create-nuxt-app -g.
You can install create-nuxt-app locally using npm install create-nuxt-app and globally with npm install -g create-nuxt-app.
I finally found an answer here and there:
This execution screenshot from #manniL on Github is helpful also:
To check the existing NuxtJS Version of the project,
run yarn why nuxt on your terminal from the project root directory.
If you want to check for the VueJS version, install Vue Developer tool web extension, and check for Vue version.
source
If you have installed create-nuxt-app globally using npm, first uninstall that. Using the below command.
npm uninstall -g create-nuxt-app
Then reinstall it. And the latest version of the package will be installed.
npm install -g create-nuxt-app

How do I install webpack version 4.19.1?

My system already has webpack version 4.27.5, but I need to uninstall this version and then use an older version 4.19.1, instead. I'm using Ubuntu.
I've run the command:
npm uninstall <web package>
but my issue was not resolved.
I recommend you to create a .npmrc file and add it
save-exact=true
This will prevent you from get packages like "^4.19.1", which AFAIK this means, get any package above 4.19.1
and then just install the needed package using the following command
npm install webpack#4.19.1 --save-dev

You are running version v6.10.3 of Node.js, which is not supported by Angular CLI v6

I am having trouble with this error, my project need run angular/cli version 1.7.4 and Nodejs 6.10.3 .But the past I used angular cli version 6 and now I want to downgrade to angular cli 1.7.4 but I don't know how to downgrade angular cli version 6 at my global. I try to use npm uninstall -g #angular/cli and then I install the version I want by command npm install -g #angular/cli#1.7.4 but when I check ng -v it's still have a error in picture
P/S: I were updated my npm to latest version to make sure can remove angular cli version but still don't work
Keep your global package running at the highest version. If a project needs CLI 1.x, use the npm run commands instead.
Any npm commands run use the project's CLI, not your global version.

Install a dependency "matching" the project dependencies

I have an ionic application.
ionic 4.7.0 requires rxjs#^5.0.1 so I installed an angular version to match that rxjs dependency, that is angular 5.2.10.
Now I am trying to install ngx-translate/core.
Installing the latest version will require having angular >= 6.0.0-rc0.
Is there a way to specify to npm to install the latest ngx-translate version which needs angular to be no more than 5.2.10? or is there a better way to handle this kind of problem with npm?