Error during migration from npm to yarn - The engine "node" is incompatible with this module - node.js

in my project I am trying to migrate from npm to yarn.
I simply ran the "yarn" command to generate the "yarn.lock".
During the process, it showed me the following error:
error linearicons#1.0.2: The engine "node" is incompatible with this module.
Expected version "^12.13.0". Got "10.19.0" error Found incompatible module.
So I ran the command "npm remove linearicons" then "yarn" to generate the "yarn.lock" without error, then "yarn add linearicons". But it gives me the same error as above.
My Yarn version is 1.22.10
Node version : v10.19.0
What could I do to fix this problem? I don't understand what he wants

Update the node.js version :
Installation of nvm
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
$ source ~/.bashrc
Looking for existent versions of node.js
$ nvm ls-remote
Installation of the last one (as of today)
$ nvm install v16.8.0
After that your issue should be fixed.

yarn install --ignore-engines
This worked for me, and it was showing this error:
webpack-dev-server#4.5.0: The engine "node" is incompatible with this module. Expected version ">= 12.13.0". Got "10.19.0"
Final result after --ignore-engines
success Saved lockfile.

Related

Create-next-app fails nvm node 16 doesn't work

Trying to create a new next app with yarn create next-app.
It fails with this error:
error #eslint/eslintrc#1.0.5: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "14.15.3"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact --cwd /Users/helenkent/Documents/Code/projects/lick-city-vote --dev eslint eslint-config-next has failed.
I upgraded my node version to 16, so when i check with node --version I get v16.13.1
When I tried to make the next app again I got the same error message as before, so its not seeing that I've upgraded node.
Don't really know what I'm doing when upgrading node so first I downloaded and clicked install on 16.13.1 from here https://nodejs.org/en/ but that didnt work when i checked the node version on the cmd line. Next I tried nvm install 16 and nvm use 16. That then showed node version 16.13.1 but like I said above, it still didn't help with the error as its somehow still picking up v14.15.3
Where did I go wrong?
npm install -g npm#latest
npm install node
npm install -g yarn
yarn cache clean
npx create-next-app#latest
Try these steps, I was facing the same error and after searching for 1 hour I found this solution. Although it was for react app, it work for me.
Here is the original solution.
https://stackoverflow.com/a/58252362/11674006

npx create-react-app -> The engine "node" is incompatible with this module. Expected version ">= 10.x". Got "8.16.0" - Arch Linux

I know this has been here many times, but it just doesn't work. I use Arch Linux. Everytime I try to run
npx create-react-app my-app
or
npm create-react-app my-app
I get
error #pmmmwh/react-refresh-webpack-plugin#0.4.3: The engine "node" is incompatible with
this module. Expected version ">= 10.x". Got "8.16.0"
error Found incompatible module.
When I type node -v I get 14.16.1 and npm -v -> 7.10.0
Looks like the node version doesn't appear update to 14.x version. Maybe?
I have tried updating sudo npm install -g npm and sudo n stable.
When I try sudo npm install npm#latest -g I get a lot of Missing write access to /usr/local/lib/node_modules/.............
The fix was that I had installed node via pacman and via Snap Store (I didn't know about it) and I saw in WebStorm that there is some node v 8.16.0 installed. So i uninstalled the snap version and it's working. Looks like create-react-app was using the snap version

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.

Unknown error: SyntaxError: Unexpected token 'export' on ng command

I'm trying to learn Angular
I've followed the steps here: https://angular.io/guide/setup-local to get it setup on Ubuntu 18.04.5 LTS
When I try to create a new project with ng new I get an error:
$ node -v
v14.12.0
$ npm -v
6.14.8
$ ng new test
Unknown error: SyntaxError: Unexpected token 'export'
$ ng -v
Unknown error: SyntaxError: Unexpected token 'export'
I installed it via sudo npm install -g #angular/cli which gave no errors.
I've purged node sudo apt-get purge nodejs and reinstalled and removed ng sudo npm remove -g #angular/cli then reinstalled again sudo npm install -g #angular/cli, still get this error. Any ideas?
There was an older version of nodejs on the system originally; I upgraded to 14.x. Export is part of ES6, perhaps it's related? I can't seem to figure it out.
I had the same issue and I could fix it by downgrading node to v12.8.1
You could use nvm as follows:
install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
refresh .profile
source ~/.profile
install node v12.8.1
nvm install v12.8.1
check that you are using the 12.8.1 version
nvm list
check ng again
ng -- version
You are using an incompatible NodeJs version. Install a lower version.
More information here (webarchive version).
Check for node versions.
use nvm
brew install nvm
I had the same problem. if you have any other version of Node that might fix it
On the Angular Github
node requirement is below
"engines": {
"node": ">=10.13.0 <13.0.0",
"yarn": ">=1.22.4"
}
after installing the older version
nvm install 12.4.0
then
nvm use 12.4.0
this did the fix for me
For me no solution worked so I uninstalled everything, both the angular and node cli, thinking that it was a version error, but when I typed ng in the console, the error kept appearing so I found where ng was, with whereis ng, delete the file and install all over again.
Run the following command on cmd. This recommends that you always update to the latest patch version, as it contains fixes we released since the initial major release. For example, use the following command to take the latest 10.x.x version and use that to update.
ng update #angular/cli#^<major_version> #angular/core#^<major_version>
First of all Don't run any command which is collected from here and there. Simply follow these steps.
1 uninstall current NodeJS version
2 download lowest version from here.
3 install the lower NodeJS version.
4 restart cmd Promat/terminal and try.
This worked for me.
Have encountered this error many a times in past.
What worked for was removing the package.lock and node_modules & rerun the npm install.
cached code might be causing the trouble.
Install a newer node version and also reinstall angular. For me it did not work with only installing a newer node.

'npm run build' have these errors

I think my node version and npm version are too low ,but I got node 6.1.0 version ,there are same errors,I try to npm clear cache,npm i,or rm node_module,no use?
Snap shot of Error

Resources