Nodejs with macOS: # Fatal error in , line 0 - gatsby develop - node.js

I am using gatsby cli, Suddenly gatsby develop command returning an error even if I create new site from scratch. I am using M1 macbook pro with big sur, is there anyone faced same issue? if yes how to resolve this?. I have configured everything properly by following official doc, am I missing something?
here is my terminal screenshot
Error:
macOS 11.2: Fatal error Check failed: allocator->SetPermissions
Parts of the stacktrace:
#
# Fatal error in , line 0
# Check failed: allocator->SetPermissions(reinterpret_cast<void*>(region.begin()), region.size(), PageAllocator::kNoAccess).
#
#
#
#FailureMessage Object: 0x16f986408
1: 0x100575758 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke()
...

It seems a Node-related issue. According to this GitHub thread, try:
arch -x86_64 zsh
nvm install 14
nvm alias default 14
exit
All the solutions are related to the Node version. Remember to clean your cache by running gatsby clean and removing the node_modules in each trial.
As other threads points the issue seems to be related to the latest Node version. With the snippet above you'll roll back to version 14 as a temporal workaround while the issue is being fixed.

This was fixed in Node v15.9.0 If you installled using homebrew on a mac you can do brew upgrade node to get the latest version

Unfortunately the only solution is to revert to nodejs 14, using Rosetta.
Additional here's the issue in V8: https://bugs.chromium.org/p/v8/issues/detail?id=11389
No ETA. Everyone, please stop asking for when this will be resolved.
We know about the issue and are working on it.
Also note that Node.js is still not officially supported on
macOS+arm64. We do not produce binaries for it and you can use the x64
ones in the mean time.
https://github.com/nodejs/node/issues/37061#issuecomment-772559363

I fixed this issue by reinstalling node via nvm.
I had to open Rosetta 2 Terminal first.
nvm install node
nvm use node
After these commands.
I reinstalled packages using yarn command.
this way it worked.

This works... nvm install 16
Here's the nvm install docs... https://github.com/nvm-sh/nvm

Related

Why npm install speed so slow?

i am using mac book pro - M1 chip and bigsur
but I have a problem.
the speed so slow when i install any library to npm
please click the picture i have counted
the picture, i had install the 'react-native-fast-image'
but there consumes more 1000s for installed
likewise,
i had typed in terminal, 'npm i or yarn install'
Consumes more than 30 minutes.
for solving this, i have tried deleted xcode, and webstrom, and vsc
but, there are no change in speed.
I had this exact same issue. After speaking with Genius Bar we realised I was on an old version 12 of node. Node 15.5 onwards runs natively on M1 so isn't being parsed through Rosetta 2, which was likely causing the lag.
You can check the version of node you're on by running node -v
If you're on anything below 15, if you run nvm install v15 on terminal this might solve your issue by updating your node.
I had an error at this point (you might not) saying:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools),
missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Which was solved with this.
After sorting that, when running nvm install v15 it solved the lagginess :) good luck!
You might also find even after installing the latest node, your terminal defaults to an old version (mine did to much bemusement!)
You can solve it be setting a default, check this link.
In short, run:
nvm use node
This switches to the latest installed version of node.
Today I used for the first time Node/NPM 17 and I got back to these issues of NPM install taking forever.
I switched back to Node/NPM 14 and everything works again just fine.
For those who cannot move their project to node 15 overnight.
Install node by itself by going on nodejs.org reduce drastically npm library installation on mac book pro - M1 Pro Monterey.

Create-react-app failing with error: node incompatible with css-loader

I'm simply trying to create a react app with the command npx create-react-app my-app
but get this error:
css-loader#1.0.0: The engine "node" is incompatible with this module. Expected version ">= 6.9.0 <7.0.0 || >= 8.9.0". Got "8.5.0"
I've tried updating node but it seems to not work, checking the version it says 8.5.0 just like in the error.
Even restarted my computer as a last option but that also didn't help..
Is there anything else I could try? Any suggestions are welcome.
I had the same thing and spent few hours trying to figure it out. I think it was the webpack. Finally, I ended updating the node.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Finally realised the problem was my old version of node, I had nvm installed and had to update which node version I'm using with nvm use node.
Update:
I had to use that command every time I started a new terminal session. Also had problems when some other packages were picking up the wrong node version for some reason.
That can be fixed with the command nvm alias default 10.11.0, or which ever version you want to use.
I can confirm that
nvm install node --reinstall-packages-from=node
worked well for me.
I had the same problem, Als tried some stuff and after updating the lates version of node with nvm it worked. I got it from this website: https://bytearcher.com/articles/ways-to-get-the-latest-node.js-version-on-a-mac/
nvm install node --reinstall-packages-from=node

Cannot install node.js under Windows 7: "the specified path is too long"

Using the newest node.js installer from https://nodejs.org, I run into the same error every time when it reaches the npm installation. npm 3.x was supposed to deal with this issue, but apparently it doesn't help the node.js installer. The node developers have essentially refused to do anything about it, as this problem has been around for about two years already. Unfortunately, I can't seem to find a work around. How can I get this to install?
I also had this error, trying to install node-v8.10.0-x64.msi on Windows 10.
My solution (to getting it to install; no idea if it won't break further down the line) was changing the install directory from C:/Program Files/nodejs to C:/njs/ (2nd step of current setup process).
I'm surprised those characters made the difference, and that there even is a Windows node release if there's not a proper solution to this (can't believe that maximum path length on Windows isn't modifiable), but this has seemingly worked for me.
I don't think its an installer error, actually windows is restricting the path size to be 150 char.
try reducing the file path name by copying it into direct c or d drive.
Check the link below Microsoft Forum
I've used Choco
It works together with NVM 4 Win.
After once installing node with choco install nodejs
then I install other versions of node using NVM e.g. nvm install 6.9.0
following by choosing that version with nvm use 6.9.0
and then verify with nvm list
and node -v.
I also need to install the latest version installed by choco using nvm install 10.1.0

Can't update from Node v0.10.46 on Mac

I'm having problem's when trying to run my gulp command in the terminal. I've been trying to track down the issue and from what I can tell the issue is that I'm running an outdated version of node.
node -v tells me that I am on v0.10.46, but the Node install downloaded from the website says it's currently on v4.4.7.
The first issue I had was with es6 promises, but I managed to install the es6-polyfill which solved the issue.
Now gulp is throwing an error related to /node_modules/gulp-imagemin/index.js. Specifically the use of const variables. (const path = require('path')).
Based on this thread: https://github.com/sindresorhus/gulp-imagemin/issues/181#issuecomment-219303510 - this issue seems to be an outdated version of node, but no matter what I do it won't upgrade!
I've explored all possible avenues for upgrading Node - using npm, nvm, n, brew and even a local re-install, but everytime it seems to be installing an outdated version.
I've explored the possibility that I'm installing a 32bit version on a 64bit system, but that doesn't seem to be the issue either.
I have absolutely no idea how to progress fixing this issue. I'm trying to build a wordpress website, and no matter what theme I use this error comes back to haunt me!
Help!
EDIT:
Just to add.. in this image (http://imgur.com/a/OzR5Y) you can see the output of me trying to upgrade using N, and then following the David Walsh upgrading method.
I had the same problem and I tried everything from uninstalling it by this instructions without any result. But maybe you have in your computer a management like nvm installed, just try this:
which node
And then if the respond of that is something like:
/Users/MYUSER/.nvm/v0.10.46/bin/node
That's the problem, so you can solve this by uninstalling nvm and then install Node.js normally or just keep using nvm

How to install older version of nodejs via n?

I've newly set up an environment, and installed nodejs from github, 0.11.14-pre. npm as well, 1.4.9. So, the problem is that my entire code base is on node#0.6.9. Upgrade isn't my option because it's too much work for it. I tried sudo n 0.6.9. It gives me Error : invalid version 0.6.9. Also I tried sudo n 0.10.28, and worked perfectly.
Is there any way to install node#0.6.9 manually or via n?
EDIT
nvm worked great for me, though it took me hours to install and run nvm. Also - I had a problem to have nvm install nodejs as a normal user due to a permission denial of creating a folder. But nvm-global solved my problems and was easy to install.
https://github.com/xtuple/nvm
Haven't tested this yet.. but this Node Version Manager looks really promising
Github: Node Version Manager

Resources