Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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() 
...
like image 591
Musharof Chowdhury Avatar asked Feb 04 '21 08:02

Musharof Chowdhury


People also ask

Can you use node js on Mac?

You can install Node. js on your macOS using the . pkg installer from the official website of Node. In addition, we can also install Node on macOS using the package manager Homebrew.

What is node on Mac?

Node. js® is a JavaScript-based environment which you can use to create web-servers and networked applications. You can also use it to perform helpful tasks on your computer such as concatenating and minifying JavaScript files and compiling Sass files into CSS.

Does NPM work on Mac?

js and NPM you'll first need to have some familiarity with the Mac Terminal application. Terminal lets you dig into the underbelly of the operating system and issue text commands to your computer. You'll need to use Terminal (or a similar application like iTerm) to not only install Node. js but also to use it and NPM.

Does node js work on M1 Mac?

So far, the transitions are pretty smooth, and many developer tools have also been updating their latest versions to work natively with the M1 machine (yes, including docker). If you are installing Node. js, I recommend using Node Version Manager (nvm) over Homebrew.


2 Answers

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.

like image 166
Ferran Buireu Avatar answered Oct 18 '22 03:10

Ferran Buireu


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

like image 30
cesarcruz91 Avatar answered Oct 18 '22 04:10

cesarcruz91