Vercel Node version incompatibility (Node, npm) - node.js

I installed 'react-bidirectional-infinite-scroll' but it seems to be using node v9/8 and when I deploy the project over vercel it throws
error react-bidirectional-infinite-scroll#2.0.1: The engine "node" is incompatible with this module. Expected version "^9.2.0 || ^8.0.0". Got "12.20.1"
error Found incompatible module.
I tried as someone suggested to place the following inside package.json:
"engines" : {
"node" : "<=9.2.0"
},
"engineStrict" : true,
but then the error becomes
Error: Found `engines` in `package.json` with a discontinued Node.js version range..etc

It sounds like react-bidirectional-infinite-scroll is unmaintained. See this related issue.
You can try to set your Install Command to yarn install --ignore-engines and hope it works correctly with newer Node.js versions, but its probably best to swap that dependency for something that supports Node.js 12 or 14.

Related

expo-cli#6.0.6: The engine "node" is incompatible with this module. Expected version ">=12 <=16". Got "18.10.0"

I was running my code about 9 hours ago with no problem. Now, npx react-native run-ios does not work. I figured maybe I needed to run yarn to fix some dependencies, and running yarn got 2/4's through the process before returning the following error...
expo-cli#6.0.6: The engine "node" is incompatible with this module. Expected version ">=12 <=16". Got "18.10.0"
Now I understand what this is telling me, that the expo-cli dependency needs a node version between 12.0.0 and 16.0.0, but I'm slightly taken aback by this, the only way that makes sense to me is if the expo-cli literally updated yesterday night.
I added the following to my package.json in hopes to mitigate the error to no avail...
"engines" : {
"node" : "<=16.0.0"
},
Do I need to downgrade / upgrade the expo-cli? I'm using bare RN but with expo modules appended to it
Weird issue, I restarted my machine and the error disappeared entirely. Hopefully this doesn't happen again or if it does, its as easily fixable

Firebase deployment error using node 12 in vscode

I am trying to deploy a firebase project (functions/hosting) and in my functions package.json, I changed the engine to node 12 because some of my other packages required it to be at least node 12 (previously it was node 10).
When I try and deploy using vscode, I get this error:
Error: package.json in functions directory has an engines field which is unsupported. The only valid choices are: {"node": "8"} and {"node": "10"}. Note that Node.js 6 is now deprecated.
After spending a few hours trying to get this to work, I was able to deploy from my terminal using firebase deploy, but it's still throwing the same error when I try and deploy directly from vscode. From the firebase documentation it seems like node 12 should be available? https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version
I also ran npm install -g firebase-tools to update my firebase tools.
From the log of the failure, I am using:
2 info using npm#6.14.16
3 info using node#v12.22.12
If the package.json file in your functions dir has :
"engines": {
"node": "12"
}
Then you are fine.
Firebase supports up to Node 16.
It sounds to me like your VS Code environment has a different version of node installed than your terminal - which could also mean that you have a different (older) version of firebase-tools being used by VS Code.
To test this just run this in both your terminal and VS Code and compare the results :
node --version

Node error when I run npm with laravel breeze

I have this error when I run npm run dev or npm run watch and I didn't find what is the mess. It's happens in a all fresh Laravel 8 app.
It looks like happen when I use the developement command
ERROR in ./resources/css/app.css
Module build failed (from ./node_modules/css-loader/index.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js):
TypeError: [(...variantsValue),(...extensions)].flat is not a function
at /var/www/html/smart_recipe/node_modules/tailwindcss/lib/util/resolveConfig.js:219:73
at baseMergeDeep (/var/www/html/smart_recipe/node_modules/lodash/_baseMergeDeep.js:42:7)
at /var/www/html/smart_recipe/node_modules/lodash/_baseMerge.js:27:7
at /var/www/html/smart_recipe/node_modules/lodash/_createBaseFor.js:17:11
at baseMerge (/var/www/html/smart_recipe/node_modules/lodash/_baseMerge.js:24:3)
at /var/www/html/smart_recipe/node_modules/lodash/mergeWith.js:36:3
at /var/www/html/smart_recipe/node_modules/lodash/_createAssigner.js:30:9
at apply (/var/www/html/smart_recipe/node_modules/lodash/_apply.js:15:25)
at /var/www/html/smart_recipe/node_modules/lodash/_overRest.js:32:12
at mergeVariantExtensions (/var/www/html/smart_recipe/node_modules/tailwindcss/lib/util/resolveConfig.js:218:33)
at resolveVariants (/var/www/html/smart_recipe/node_modules/tailwindcss/lib/util/resolveConfig.js:235:10)
at resolveConfig (/var/www/html/smart_recipe/node_modules/tailwindcss/lib/util/resolveConfig.js:271:15)
at /var/www/html/smart_recipe/node_modules/tailwindcss/lib/index.js:77:37
at /var/www/html/smart_recipe/node_modules/tailwindcss/lib/processTailwindFeatures.js:52:20
at LazyResult.run (/var/www/html/smart_recipe/node_modules/postcss/lib/lazy-result.js:288:14)
at LazyResult.asyncTick (/var/www/html/smart_recipe/node_modules/postcss/lib/lazy-result.js:212:26)
at LazyResult.asyncTick (/var/www/html/smart_recipe/node_modules/postcss/lib/lazy-result.js:225:14)
at /var/www/html/smart_recipe/node_modules/postcss/lib/lazy-result.js:217:17
at runLoaders (/var/www/html/smart_recipe/node_modules/webpack/lib/NormalModule.js:316:20)
at /var/www/html/smart_recipe/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /var/www/html/smart_recipe/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at context.callback (/var/www/html/smart_recipe/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Promise.resolve.then.then.catch (/var/www/html/smart_recipe/node_modules/postcss-loader/src/index.js:208:9)
# ./resources/css/app.css
I came across same issue and spent 5 hours on finding solution but could not.
After searching alot, I came across this
"Tailwind CSS v2.0 no longer supports Node.js 8 or 10. To build your CSS you'll need to ensure you are running Node.js 12.13.0 or higher in both your local and CI environments."
at https://tailwindcss.com/docs/upgrading-to-v2
So I realized that issue was in my Node version which was 10.x so
I uninstalled Node from my windows machine and downloaded LTS version (14.x).
So consider updating your Node version, it will solve the issue as it did work for me.
There is possibility that old node versions don't have that flat function that Tailwind CSS 2 has implemented and that's throwing error.
I Had the exact same issue after installing Breeze... Unfortunately the npm error message gives no clue of what is really going on !
Thanks to #DaniyalGondal I found out that my node version was raising the error because of tailwind V2 requirements (https://tailwindcss.com/docs/upgrading-to-v2) that comes with Breeze... So I did upgrade my node version using : sudo n latest under ubuntu20
Don't forget to restart your terminal after upgrading and check that your node is correctly upgraded using : node --version
If the node version is above 12.13.0, now npm run watch or npm run dev should work fine !

Error: Module version mismatch. Expected 47, got 48

I'm writing a Visual Studio Code extension which uses a native node.js module. When I try to debug this extension in vscode I get the error message from above, when loading the native module (when commenting out the require() call no error comes up). It tried quite a few steps to overcome + test this:
npm uninstall native-module followed by a npm install native-module --save-dev in my vscode extension folder, this compiled the native module completely and without problems.
Completely cleaned my node_modules folder in the extension and did again the npm install --save-dev.
Installed node.js again, both LTS and current. With LTS the error message changes to: expected 47, got 46.
Installed latest vscode (August recovery build)
Launched a node session in my vscode extension folder and loaded my native module. This works nicely.
Read the various questions and comments here on SO. They mostly recommend what I described above.
Still, I cannot get vscode to accept my native module. What can I do? From the above steps it appears as if vscode has been built with a node.js version between current and LTS. Can I force my native module somehow to use a specific version?
Btw. what do those numbers 48, 47, 46 etc. actually mean? The node.js version is of course in the typical form: major.minor.build and nothing of that matches the above version numbers.
Update:
ok, I found what those numbers mean: https://nodejs.org/en/download/releases/
Once you know what those numbers in the error message mean it's easy to solve the issue. Simply install the node.js version that is expected. In my case it's node.js 5.12.0.
Remove node_modules folder
Run npm update
Then;
Run npm install

node js on azure - deeply nested node modules cause error

I'm using a node module called swagger-tools, which internally depends on lodash. When swagger tools is installed, the depth of its node_modules folder is very big, which causes an error on my azure web app (a Windows server). I saw somewhere that this problem can be solved by using npm 3, and while npm 3 is installed on azure server, I can't force it to use it - the error logs indicate that npm 2 is being used. This is how I do it in package.json:
"engineStrict": true,
"engines" : {
"npm" : ">=3.0.0"
}
The node version is 4.4.7.
If anyone knows about a different way to fix the issue I will be glad.
you are correct that NPM 3 should solve the issue because it uses flat file system and not nested dependencies in which windows file system doesn't support well.
To force NPM 3 it really depends on your publish method (git/vs).
Here is a guide for forcing NPM 3 -
https://blogs.msdn.microsoft.com/azureossds/2015/09/13/npm3-on-azure-web-apps/
Set the npm path to the absolute location to the npm 3 on Azure Web Apps file system in Custom Deployment Script as described by #shachar will be a solution.
And additionally, there is a easier workaround. You can define the nodejs version in your package.json to the version which contains the npm 3. The lowest nodejs version which contains npm3 is 5.0.0.
So, you can simply modify the engines section in your package.json:
"engines" : {
"node" : "5.0.0"
}
You can refer https://azure.microsoft.com/en-us/documentation/articles/nodejs-specify-node-version-azure-apps/ for more info.

Resources