Codelyzer requires Angular 9 instead of Angular 10 - node.js

When I am running the command npm ls -json in my node js project I get the following error:
npm ERR! missing: #angular/core#9.0.0, required by codelyzer#6.0.2
npm ERR! missing: #angular/compiler#9.0.0, required by codelyzer#6.0.2
#angular/core and #angular/compiler are already installed in the dependencies of my project, but with version 10.2.4
The error only occures when I am running yarn install to install my packages. If I am using npm install everything works fine, but takes a while.
Is there any version of codelyzer that uses Angular 10 instead of Angular 9 or some other package that solves the same problem?
Environment:
OS: Windows
Package Manager: yarn
Angular version: 10

I found out, that Codelyzer is deprecated and I had to remove it and install "eslint" package instead. EsLint has included all features of codelyzer.

I found this Github conversastion and based on that
I just had to update the version for Angular 10. The Codelayzer version was #6.0.0

Related

can not find module node-sass with angular 7

I cloned an old project of mine which I wish to revive.
The project is running with angluar 7 and ionic 4.
When running:
npm run build
I am encountering with the issue of Error: Cannot find module 'node-sass'
Now the environment is fresh new. with node 16.10.0 and npm 7 (those dependencies are because of the old project)
Trying to follow other questions that instruct me to install node-sass, just lead to incompatible versions.
Any suggestions?
If you are encountering an error when trying to run npm run build for an old project that was created with Angular 7 and Ionic 4, it's likely due to missing dependencies. To resolve the "Cannot find module 'node-sass'" error, try the following steps:
Uninstall the current version of node-sass by running npm uninstall node-sass
Reinstall the version of node-sass that was compatible with Angular 7 and Ionic 4 by running npm install node-sass#4.14.1
Clear the npm cache by running npm cache clean --force
Re-run npm run build and see if the issue has been resolved.
Note: It is always recommended to keep a record of the dependencies and their versions used in a project in a file such as package.json. This can help in situations where the dependencies have been updated and are causing compatibility issues.

npm ERR! Failed at the node-sass#4.14.1 postinstall script

I'm trying to install the following library in my react app: react-awesome-loaders.
However when i try to install it i get this error:
npm ERR! Failed at the node-sass#4.14.1 postinstall script.
my node-sass verison is: 6.0.1
my node version is 15.6
I have removed package-lock.json and node_modules and cleared npm cache, and then installed the packages again but that didn't help.
Any idea what the issue is?
One of your sub-dependencies is trying to install node-sass 4.14.1, which isn't supported by Node 15.
PS: Node 15 is end of life, but you may need to go to Node 14, if you need to install node-sass 4.14.1

Installing puppeteer throws error with "Failed to install script 'node install.js'"

I am trying to install puppeteer, but it gives me following error message:
npm ERR! Failed at the puppeteer#4.0.1 install script 'node install.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
Both node and npm are up to date. How can I fix this?
Your Node version is v8.10.0 which is not compatible with puppeteer 4.0.1 that you are trying to install.
Since puppeteer 3.0.0 Node.js v8.x.x is no longer supported.
You have two options:
Upgrading to Node v10.18.1+ on your Linux system (from Node.js downloads, latest LTS version: 12.18.1, or if you need multiple Node versions at the same time you can use Node Version Manager (NVM)).
Installing the last version of puppeteer which was supported on Node v8.10.0. It was puppeteer 2.1.1 and can be installed with:
npm install puppeteer#2.1.1
or if you wouldn't be sure which one was the latest 2.x.x version: you can use ^:
npm install puppeteer#^2.0.0
Of course like this you'd loose some functionality and need to make sure using this docs version: https://pptr.dev/#?product=Puppeteer&version=v2.1.1
we can do
npm install --unsafe-perm=true
if package.json already contains the puppteer config's.

NPM 5 is not supported yet in React Native

While creating an app using React native, in cmd I'm facing the following error message:
ERROR: npm 5 is not supported yet.
npm WARN deprecated socks#1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
> #expo/ngrok#2.3.0 postinstall C:\Users\Rakesh\proj\node_modules\#expo\ngrok > node ./postinstall.js ngrok - binary unpacked.
npm notice created a lockfile as package-lock.json. You should commit this file. + react-native-scripts#1.11.1 added 459 packages in 316.717s.
It looks like you're using npm 5, which was recently released. Create React Native App doesn't work with npm 5 yet, unfortunately. We recommend using npm 4 or yarn until some bugs are resolved. You can follow the known issues with npm 5 at: https://github.com/npm/npm/issues/16991
You can downgrade your npm version by following
npm install npm#4.6.1 -g
and then try running app again.
Simply downgrade npm to 4.6.1 OR Install Yarn
npm install -g npm#4.6.1
OR
npm install -g yarn
Yarn is better but I will prefer to downgrade npm because for some reason I'm getting a yarn.lock file error.

npm -v still showing version 2.x.x after installing npm3

I am starting to use Angular 2, which requires npm 3.x.x, so I installed it with npm install -g npm3. The Angular 2 tutorials tell me to verify that I have npm 3.x.x by running npm -v, however when I run that, it still says I have version 2.15.8. It shows that I have version 3.10.7 if I run npm3 -v, but not if I run npm -v. Is this going to cause errors? Do I need to it to say I'm using version 3.x.x when I run npm -v? If so, what do I need to do?
EDIT:
Node.js version: node -v reveals that I am using v4.4.7 (Angular2 requires something between 4.4.x - 5.x.x, so I should be good here)
OS: I am currently using Windows 10 on a PC, but have had the same issue with my Mac.
Upgrade npm using this command - npm install -g npm
Maybe this helps:
https://www.google.de/search?q=update+npm+windows
Updating npm with npm itself will store npm.cmd in ../appdata/roaming/.
To avoid conflicts with an older npm version you need to remove npm.cmd from C:\Program Files\nodejs\npm.cmd

Resources