Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm run Segmentation fault: 11

I'm trying to npm run

HOT=1 node ./node_modules/.bin/react-native-webpack-server start --hot

getting this error:

> [email protected] hot /Users/user_name/Documents/dev/app
> HOT=1 node ./node_modules/.bin/react-native-webpack-server start --hot

Segmentation fault: 11

there was no such error 12 hours ago. Have no idea why does this happens.

like image 683
stkvtflw Avatar asked Sep 09 '15 12:09

stkvtflw


People also ask

What does segmentation fault 11 mean?

1) Segmentation Fault (also known as SIGSEGV and is usually signal 11) occur when the program tries to write/read outside the memory allocated for it or when writing memory which can only be read.In other words when the program tries to access the memory to which it doesn't have access to.

What is Segfault in C?

Segmentation faults are a common class of error in programs written in languages like C that provide low-level memory access and few to no safety checks. They arise primarily due to errors in use of pointers for virtual memory addressing, particularly illegal access.

What does NPM rebuild do?

This command runs the npm build command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary. It is also useful when installing with --ignore-scripts and --no-bin-links , to explicitly choose which packages to build and/or link bins.

What causes segmentation fault core dumped C?

Core Dump/Segmentation fault is a specific kind of error caused by accessing memory that “does not belong to you.” When a piece of code tries to do read and write operation in a read only location in memory or freed block of memory, it is known as core dump. It is an error indicating memory corruption.


4 Answers

The suggestion to delete node_modules and re-run npm install is a good one. Even better, though: npm rebuild will likely fix the problem and be faster (since it won't actually re-download all the files etc.).

like image 98
Trott Avatar answered Sep 27 '22 22:09

Trott


There was a major node.js release yesterday, maybe that's why something went wrong. Best course of action is updating node.js/npm, deleting node_modules folder and running npm install to install dependencies again.

like image 36
Gökay Gürcan Avatar answered Sep 27 '22 22:09

Gökay Gürcan


I also got this same error, and was down to a syntax error in one of my SASS files.

like image 25
DanV Avatar answered Sep 27 '22 23:09

DanV


I also had the same issue now in my angularjs webpack project.

I checked the node version and npm

node -v

v8.11.3

npm -v

5.6.0

I updated the npm to the latest.

npm install -g npm@latest

npm -v

6.4.1

Now npm install, npm run build is working fine now. :)

like image 41
Raphael Avatar answered Sep 27 '22 23:09

Raphael