How do I install webpack version 4.19.1? - npm

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

Related

What's the fix for Error: Node Sass version 8.0.0 is incompatible with ^4.0.0?

So, I had used sass before using npm install node-sass for my reactjs project. I'm now working on a new project and wanted to use sass again. With the same syntax npm install node-sass to get it installed, I continued to get
./src/components/Main.scss (./node_modules/css-loader??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/react-scripts/node_modules/sass-loader/lib/loader.js??ref--6-oneOf-5-3!./src/components/Main.scss)
Error: Node Sass version 8.0.0 is incompatible with ^4.0.0.
Or
to import sass files, you first need to install node-sass. run `npm install node-sass` or `yarn add node-sass` inside your workspace
...
...
I followed the instructions to have sass installed from the links npmjs
sass-lang
using these syntaxes
brew install sass/sass/sass
npm install -g sass
but I'm still encountering either errors I mentioned earlier.
I tried deleting the node-module folder, package-lock.json and reinstalled node-modules. That still did not fix the error. Also, I followed how others got around fixing Node Sass version 5.0.0||6.0.0|| 7.0.0 incompatibility issue but that did not fix mine.
I'm seeking help now.
Don't use node-sass anymore
You can easily fix it by the following.
npm uninstall node-sass
npm install sass
This is because node-sass is now deprecated. You will have to install its new version which is sass. Sinc it works all the same and better, this will easily fix the issue without making any additional changes.
And all Works well !
But if you still prefer to use node-sass
You can use the following table to install the appropriate version node-sass for your installed Node.js version which you can check by the command node --version.
npm install node-sass#(your version)
update sass-loader, or remove and install again.
Try this: In your packege.json file, delete "node-sass": "^4.12.0" and replace it with "sass": "". This did it for me.
You can follow these two steps:
Uninstall your node-sass:
npm uninstall node-sass
Install old version node-sass:
npm install --save-dev --unsafe-perm node-sass#4.14.1
It's okay now
The answer for me was to update react-scripts to 4.0.3. I couldn't do the latest version of react-scripts because it still requires a bunch of hacks to make packages work that had polyfilled modules automatically loaded before.

How to update npm package's dependency?

I am trying to update dependency of package I am installing trough npm.
When I install appium package, I get version 1.22.0 which is correct. But this package also have dependencies that getting regular updates on github and are propagated on npmjs.
But when I install main package, dependency is not latest.
For example, I need to update appium-espresso-driver dependency of appium to 1.50.1, but everytime I install appium, dependency is only 1.45.3, even when appium have ^1.0.0 in package.json
How to update this? Do I need to wait for appium package to be bumped?
If you want to update all the packages to the latest version and you are using npm, you can see this documentation npm-update, but the short answer is:
npm update
This helps to update every package of the project, you can do it in the root folder, and update everything in the package.json.
If you want to update everything to a latest version, you can use npm-check-updates, this will check the latest version of the packages that you have installed on package.json, I will show you the easy steps to install this but you can go through the documentation of the module in here:
npm install -g npm-check-updates
This will install you the package, then after that you need to run in in the root folder:
ncu -u
So after that command it will update all the packages in the package.json but not install them, so after running ncu -u you need to run again:
npm install
To install the new versions of the package.

Purescript version change issue

My current purescript version is 0.11.7, I would like to change it to 0.12.0. I have tried uninstalling using npm uninstall -g purescript and it gets successfully uninstalled but still purs --version gives 0.11.7. I have also tried running npm install -g purescript#0.12.0 and it does get successfully installed but still purs --version gives 0.11.7. Please help!
Maybe you installed the package globally via yarn. Try yarn global remove purescript

How to Update Angular Cli

Just to give you some context.
I was running a project and after ng serve I was getting this warning message:
our global Angular CLI version (9.1.4) is greater than your local
version (1.0.0). The local Angular CLI version is used.
I googled and figured out I should update angular cli with the following command.
npm install --save -dev #angular/cli#latest
After that I am getting the following error when trying to build the project:
The build command requires to be run in an Angular project, but a project definition could not be found
Any help will be much appreciated.
After reading some issues reported on the GitHub repository, I found the solution.
In order to update the angular-cli package installed globally in your system, you need to run:
npm uninstall -g angular-cli
npm install -g #angular/cli#latest
Depending on your system, you may need to prefix the above commands with sudo.
Also, most likely you want to also update your local project version, because inside your project directory it will be selected with higher priority than the global one:
rm -rf node_modules
npm uninstall --save-dev angular-cli
npm install --save-dev #angular/cli#latest
npm install
After updating your CLI, you probably want to update your angular version too
Note: if you are updating to Angular CLI 6+ from an older version, you might need to read this
Edit: In addition, if you were still on a 1.x version of the cli, you need to convert your angular-cli.json to angular.json, which you can do with the following command:
ng update #angular/cli --from=1.7.4 --migrate-only
check here for more details.

Cannot get "npm install #feathers/cli -g" to work in the command line

I get this error message when I try installing feathers from npm
npm WARN deprecated nomnom#1.8.1: Package no longer supported. Contact support#npmjs.com for more info.
npm WARN deprecated babel-preset-es2015#6.24.1: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
Help!!
As Vasan pointed out in the comments, running
npm install -g #feathersjs/cli
from the command prompt on Windows installs a file feathers.cmd in the folder:
%APPDATA%\npm
If this folder is not on your PATH, then feathers will not be recognised as an executable - it appears that the global install doesn't add it to the path automatically.
Editing system environment variables to add this folder to your path should make the feathers cli tools available.
Note that after altering your path you may need to restart your terminal for the updated path to be available.
Its very simple, if you have an earlier version installed, uninstall the old feathers-cli using:
npm uninstall feathers-cli -g
Then install #feathersjs/cli and upgrade a project by the following commands:
npm install #feathersjs/cli -g
cd path/to/project
feathers upgrade
I also faced with the installation issue. But got an error: 404 Not Found: babel-messages#^6.23.0. I've solved it when run npm install #feathersjs/cli -g through the windows terminal (cmd). Before that I was running it on bash.
This issue also occurs when installation is ran using Admin credential(Windows 10), reinstall without elevated cmd/powershell credential also solved the problem.