Looking for fix - node.js

npx create-react-app online exam
npx: installed 98 in 34.58s
Creating a new React app in /home/oem/online.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
yarn add v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
error #typescript-eslint/eslint-plugin#2.24.0: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.0.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
my node version-: node -v
v14.8.0
my npm version-: npm -v
6.14.8

The #typescript-eslint/eslint-plugin package only supports Active LTS and Maintenance LTS of Node releases. You are using the Node version of v14.8.0 which is not an LTS version.
According to #typescript-eslint/eslint-plugin docs
This project makes an effort to support Active LTS and Maintenance LTS release statuses of Node according to Node's release document. Support for specific Current status releases are considered periodically.
More information about Node's release can be found here. Try switching an LTS version of the Node. The latest LTS versions can be found here.

Related

node 19 hangs when installing Realm

I am trying to install realm in a fresh react-native project. but when I run this command yarn add realm or npm I realm it always stop on this step.
[4/4] 🔨 Building fresh packages...
[1/1] ⠄ realm
and nothing is happening. I have tried many version to install but same issue,
As #engr-aftab-ufaq said, installing nvm and then using the latest LTS version (v18.14.0 as I'm writing), then re-running npm install realm, fixed the problem for me
For node 19, you can try this
npm install --save realm#11.4.0
Please check for compatibility with you node and react native version: https://github.com/realm/realm-js/blob/master/COMPATIBILITY.md

Unclear - Unsupported node-sass with current environment

Trying to set up instance of Facebook CTF on an AWS EC2 instance running Ubuntu 16.04 and am running into the following error when doing the quick setup.
My current version of node-sass and node are
$ node -v
v15.4.0
$ npm node-sass -v
7.0.15
Interestingly, I get another vesion of node
$ npm node -v
7.0.15
The first two are supposedly compatible according to the Node Version Support Policy table on GitHub. The node version 7.0.15 is not compatible with the version of node-sass.
However, when I run grunt, it indicates an unsupported environment.
Note: I have tried using individual sass commands and it works.
grunt --force
Loading "sass.js" tasks...ERROR
>> Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (88)
>> For more information on which environments are supported please see:
>> https://github.com/sass/node-sass/releases/tag/v3.13.1
What I have tried/done-
Uninstall node-sass (include using -g, clear cache, remove package-lock.json) but oddly enough, node-sass does not get uninstalled.
Questions -
Why does the error log reference an older release of node-sass (v3.13.1)?
How do I reconcile versions?
Does it make a difference if some packages were installed as root user vs. regular user?
Solved it!
Why was I getting the error?
Tracing package.json and package-locked.json files both indicate the older version
"node-sass": "^3.7.0" and not the version I installed manually.
Solution -
uninstall node-sass, node
delete their node_module folders
run "npm install" to install any dependencies missing (node-sass and node)
Such that now when I check the versions installed, my output is as follow -
user#IP:/var/www/user# node -v
v6.17.1
user#IP:/var/www/user# npm node-sass -v
3.10.10
When reviewing the Node Sass support policy table on GitHub, these two versions are compatible. When I run grunt --force, there are no issues for node-sass.

I am getting various warrnings and errors when trying to create react app with npx

I am trying to create react app with npx and get the following error: error fork-ts-checker-webpack-plugin#1.5.0: The engine "yarn" is incompatible with this module. Expected version ">=1.0.0".
Any ideas what could be the source of the issue? any tips would be appreciated. Thanks!
npx create-react-app food
npx: installed 91 in 5.566s
Creating a new React app in /home/oren/m/code/food.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v0.16.1
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents#1.2.9: The platform "linux" is incompatible with this module.
info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
warning fsevents#2.0.7: The platform "linux" is incompatible with this module.
info "fsevents#2.0.7" is an optional dependency and failed compatibility check. Excluding it from installation.
error fork-ts-checker-webpack-plugin#1.5.0: The engine "yarn" is incompatible with this module. Expected version ">=1.0.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /home/oren/m/code/food has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting food/ from /home/oren/m/code
Done.
About my environment:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
$ uname -a
Linux oren 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
node -v
v12.8.0
npm -v
6.10.2
I have solved by installing latest version of Yarn.
- first uninstall version
- installed latest version npm install -g yarn
- removing yarn cache folder in the AppData folder has solved my issue C:\Users\test\AppData\Local\Yarn
Look at this line in the log error fork-ts-checker-webpack-plugin#1.5.0: The engine "yarn" is incompatible with this module. Expected version ">=1.0.0". It says your yarn version is not compatible. You have yarn v0.16.1 but it has to be above 1.0.0. Please try to update your yarn version.
If anyone else is struggling with this even after uninstalling/reinstalling yarn from npm, for me I actually had an old version of yarn installed outside of npm or another package manager, and I had to uninstall it from the Add or Remove Programs list in Windows.

Node version issue when creating Vue CLI 3 app

I have installed the latest Vue CLI to version 3.1.3.
I'm trying to create a new app with vue create app
This goes fine until Yarn tries to install the dependancies:
yarn install v1.12.3
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
error eslint#5.9.0: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "8.9.4"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ERROR command failed: yarn
node --version shows I'm using 8.9.4.
When I try to update node via homebrew I get an error saying I already have node 11.2.0:
Simons-MBP-2:~ Simon$ brew upgrade node
Updating Homebrew...
Error: node 11.2.0 already installed
Simons-MBP-2:~ Simon$ node --version
v8.9.4
Could this be related to a 'path' issue. I am trying to create my vue app on a directory in my regular path where all my other projects are.

error eslint#5.6.0: The engine "node" is incompatible with this module. when trying to create-react-app

I am trying to create a React App and I am getting the following error in my console.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.10.1
info No lockfile found.
[1/4] 🔍 Resolving packages...
warning react-scripts > eslint > file-entry-cache > flat-cache > circular- json#0.3.3: CircularJSON is in maintenance only, flatted is its successor.
[2/4] 🚚 Fetching packages...
error eslint#5.6.0: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "9.5.0"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /Volumes/server2/Desktop/JavaScript/birdcage has failed.
Deleting generated file... package.json
Deleting birdcage / from /Volumes/server2/Desktop/JavaScript
Done.
I have tried brew upgrade node but that didn't seem to work. Any ideas on how this can be fixed would be greatly appreciated.
One of the temporally fix is to run yarn install --ignore-engines
I was facing the same issue, try to add "--use-npm" at the end of create react app commend.
create-react-app appname --use-npm
I had the same problem, simply doing this solved the problem:
npm install node#latest
Try to uninstall yarn and install it via npm.
npm i create-react-app -g
create-react-app yourappname
Make sure that node is installed!
I had the same problem, try it:
yarn config set ignore-engines true
I re-installed node and updated xcode developer tools. Also, re-installed React on that computer which is running Mojave.
Assuming nvm is installed, use it to see which version of node you're using, then use it to change to a later version.
you can change the version with nvm use <version> and then try again
In my Ubuntu 18.04 had a native version from the OS installed that not listed by NVM.
I removed it and then I ran:
Firstly run, nvm install 14.5.0
then run, nvm use 14.5.0
And the installation completed properly.
i had same issue when i was adding router plugin to vue-cli with npx and yarn as well..
In pyhton virtual environment i have updated node version from 8.x.x to 16.x.x and used command nvm use 16.x.x but still problem persists .. i was actually executing command as root .. so nvm is using node version as 8.x.x only ..
after long time i realised executing command with sudo was the issue and then executed as a normal user...
this solution worked for me !!!
As the warning said, I updated node via nvm to the version required. For me having the latest node lts version was enough.
nvm install "lts/*" --reinstall-packages-from="$(nvm current)"
But even after upgrading node, yarn still gave the error.
The problem was npm was still executed from the old .bin path of previous node version. nvm also installs latest version of npm in respective local .bin folder for the node version installed.
I used the following commands then,
nvm install-latest-npm: Attempt to upgrade to the latest working npm on the current node version
nvm install --latest-npm: After installing, attempt to upgrade to the latest working npm on the given node version
After this, it worked properly.
Reference:
How can I change the version of npm using nvm?

Resources