Unclear - Unsupported node-sass with current environment - node.js

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.

Related

"Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (108)"

I am trying to run Experience builder on windows 11 64 bit.
My Node version is V18.12.1 and npm version is V8.19.2 (Both the version are LTS version)
Whenever I am trying to run "npm start" command (in cmd) from the client folder of experience builder, I am getting this error "Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (108)"
If anyone can help.
This error message does not indicate an problem with Ionic, but rather with node-sass, which is specified to execute in your Gulp file. The node-sass error, Node Sass does not yet support your current environment indicates that the version of node-sass you are trying to run is not compatible with the version of node installed.
Check the Node Sass release notes for the version of node-sass you have, to see which version of node is required. If the version of node is wrong, you must downgrade node, or upgrade node-sass, until you have a compatible pair. If the node version is supported, you may just need to run npm rebuild node-sass (with -g if node-sass was installed globally). If that doesn't work, you can npm uninstall node-sass && npm install node-sass (again, with -g if necessary).

The engine "node" is incompatible with this module. Expected version "7.5.0". Got "15.13.0"

one of my friends sent me a project using react and node and i tried to run it with yarn. Each time i run this command i got this error : The engine "node" is incompatible with this module. Expected version "7.5.0". Got "15.13.0". I just want to know how update the react version of a project
Have a good day
You can change your package.json
"engines": { "node": ">=7.5.0"},
This will make the projects run with node 7.5.0 or newer versions. Also using nvm
nvm install version_you_want
nvm use version_you_want
Check node and npm versions
node -v
npm -v
Other option is to use
yarn install --ignore-engines
See this post: How to fix engine "node" version?
In my case I was gettin the same error because I didn't set the .env file
You could use this npm package, but be aware of breaking changes especially as it seems to be a very old version.
A better approach may be to use nvm - node version manager (or nvm-windows if that is your operating system) to install and use an older - compatible version of node, e.g. v7.5.0.

npm does not support Node.js

npm does not support Node.js v15.5.0 as well as v14.15.3
npm Version: 5.6.0
I upgraded it trough the command: npm i -g npm-upgrade
But I don't get version 6, I always get version 5.6.0
I also tried different Node.js versions according to 426750.
I tried following Node.js versions: v15, v14, v12, v9. It doesn't matter which Node.js version I install, i always get the samme error.
I also removed Node.js and updated it as recommended in 47226238, 63196042.
I have no Idea how I can fix this problem. Do you have any suggestion?
The correct command to update npm is npm install -g npm. At the time of this writing, that will install npm#6.14.10. (If it doesn't, try npm install -g npm#6.)
Installing npm-upgrade instead will install a CLI that updates package.json in projects. It will not update npm itself.
EDIT: The version compatibility stuff is just a warning. Based on the comment below, the ERR! cb.apply is not a function stuff is the real problem. You may have multiple versions of npm or node installed in different paths and your PATH or alias configuration is causing incompatible versions to run with each other.
EDIT (continued): If you are using nvm as a version manager, you can downgrade to a previous version, remove/reinstall the current version of Node.js, and you will have a compatible version of npm. If you are not using nvm, installing it (assuming you are on a development machine and not experiencing these issues in production) and using node and npm provided by it should also solve the issue.
EDIT PART 3: I just noticed you are running Node.js 15.5.0. That ships with npm#7 so do npm install -g npm#7. If that doesn't work, find your executable paths for node and npm. (On UNIX-like operating systems: command -v node and command -v npm.) If they are not in the same directories, that sounds like a problem and you should investigate. It will probably be easiest/best to use the npm that is in the same directory as node. You can try that out by using the full path. If that works, figure out what's wrong with your PATH or your aliases that you're using a different npm and fix that.

nodejs 4.2.6 not getting updated to latest version

I installed Node and npm as they are required to install angular cli.
Now, if I type this command:
npm install -g angular-cli
I get this message in terminal:
ERROR: npm is known not to run on Node.js v4.2.6 Node.js 4 is supported but the specific version you're running has a bug known to break npm. Please update to at least 4.7.0 to use this version of npm. You can find the latest release of Node.js at https://nodejs.org/
I also followed this link, but still the issue is not resolved.
I tried removing node, npm and then reinstalling, updating node according to all the ways I found on internet, but still the version(4.2.6) is same.
I don't understand what I am doing wrong as I am new to Linux.
Surprisingly, npm is quite complicated in Linux, until you discover Node Version Manager which allows you to easily install new versions and swap between them.
After installing nvm, you can install any node version with nvm install <VERSION_NUMBER> and you can set it as default with nvm alias default <VERSION_NUMBER>
You can swap between versions using nvm use <VERSION_NUMBER>

"Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 4.x" error BUT my current environment is 6.11

This always happen to me when I change my node version globally and is not the same as the project version installed by Maven.
Things normally work ok but node-sass always gives error. I recently updated my node version from 4.4.4 globally to stable version with nvm.
Our project setting also changed to be 6.11.3
I deleted project node-modules many times. I cleaned npm cache many times both in global and in project local.
But Grunt watch does not work because I get this
Error: Missing binding /Users/Tekin/bitbucket/ark/code/emport-web/node_modules/node-sass/vendor/darwin-x64-46/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 4.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 6.x
This is driving me insane. What is happening? I am not using 4.x anymore I rebuilt npm node-sass also even forced it.
May be there is an order of things that someone can explain.
And this is what I get when I do npm install or Jetty clean run to rebuild the project.
node-sass#4.5.3 install /Users/Tekin/bitbucket/ark/code/emport-web/node_modules/node-sass
node scripts/install.js
node-sass build Binary found at /Users/Tekin/bitbucket/ark/code/emport->web/node_modules/node-sass/vendor/darwin-x64-48/binding.node
node-sass#4.5.3 postinstall /Users/Tekin/bitbucket/ark/code/emport-web/node_modules/node-sass node scripts/build.js
Binary found at /Users/Tekin/bitbucket/ark/code/emport-web/node_modules/node-sass/vendor/darwin-x64-48/binding.node
Testing binary
Binary is fine
node-sass#4.5.3 /Users/Tekin/bitbucket/ark/code/emport-web/node_modules/node-sass

Resources