Node/TS-node crashing without a stack trace - node.js

I'm having an issue where a node project suddenly started crashing on launch with merely a error Command failed with exit code 1. The project is ApolloServer/Express based.
Start script: ts-node src/app.ts
Running via ts-node crashes right after express().listen() logs "Server is starting" message
Running through pm2 will cause a crash loop before randomly working
Running via ts-node-dev works (Uses the same version of ts-node)
Running on Windows 10 works
ts-node: "9.1.1"
ts-node-dev: "1.1.8"
typescript: "4.4.4"
node: "14.13.1"
yarn: "1.22.17"
Debian: 9.13

Related

Nestjs "Reached heap limit Allocation failed - JavaScript heap out of memory" on npm run build

I have an issue with my Nest js API.
When I build in local, all works fine and I can build and start the development server without problems, but when I go to my server I can't build or start the development server.
When I try to run "npm run build","yarn build" or start the server with "yarn start" the node returns to me this error:
I tried to run "export NODE_OPTIONS=--max_old_space_size=4096" and in the ~/.bashrc export de node options with more space. Also, i upgraded all dependencies, and deleted and installed again, but nothing works. I have the same issue with the frontend of this project that uses Next JS.
The server is an aws EC2 t3.small server with Ubuntu 20.04.3 LTS, the node version is v17.3.0, the npm version is 8.3.0 and the yarn version is 1.22.17.
When I run "tsc --extendedDiagnostics --noEmit" i have 20 errors from node_modules/#nestjs/config, I tried to update the package but doesn't work:
And finally, I get this summary:
Thanks
Well, after few hours searching a solution I updated the nest project with the command "sudo nest update --force", I removed the node_modules and executed "yarn install".
After this, I granted all the permissions to my project files with "sudo chmod -R 777 ./" and finally the "npm run build" and "yarn build" worked.
Thanks a lot!

Electron: Unable to open X display - ERROR:browser_main_loop.cc(1400) - The futex facility returned an unexpected error code

I've been trying to run this code that brings up an electron GUI and takes input from the user. I I've used the following commands to run this project in VSCode powershell terminal:
npm install
npm start
I get the following error messages in the terminal afterwards:
Error Message 1
Error Message 2
Error Message 3
I've already checked that I have the most updated packages for nodejs, npm, electron, electron-packager and electron-builder. You can see the last three in my package.json file under the devDependencies.
Package.json dev dependencies and scripts
I don't really understand what the error is saying here. From the googling I've done, it seems like this happens on WSL when you're trying to launch an electron application but I'm working off of my local machine on Windows, so I wouldn't think that a GUI should throw an error.
I can run main.js by using electron.cmd main.js but this just brings up the GUI splash from electron but the code itself doesn't seem to be executing.
The answer in my case was switching to use Yarn instead of npm. Clearing the node modules folder and running yarn install and running election ./app from the main project folder.

'npm run build' in linked dependency breaks the running react app

it seems that rebuilding a local linked dependency breaks the main package that is running with react-scripts-ts start with a "not found" for file dist/index.js of the linked module.
This is not happening in Mac OSX where after linked local module is rebuild, the running react-app automatically reloads with no problems.
In Ubuntu you have to stop the react app and run "npm run start" again.
Any clue?

vscode building and running from source hangs

I'm building vscode using the instructions here https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source. When I get to the yarn run watch command, it hangs at Finished compilation with 0 errors after 54926 ms. What's going on?
nodejs: 8.9.4
yarn 1.3.2
npm 5.6.0
I was running yarn run watch and encountered this problem. I checked with du -s in the repo's folder a few times: no change, so I killed the command.
After killing yarn run watch I then ran yarn watch and once again it hung with the same error. I checked with du again. No change. I killed that command too.
I then ran
./scripts/code.sh
And VS Code started fine. So in my experience, it is fine to kill the yarn command.

NodeJS Application stops instantly after start

I am trying to run a NodeJS application on Windows 7. It was created on a MacOSX and it worked fine, started it on a CentOS too and it's OK, but when I run it on Windows with
npm start
Node spits out the usual starting of a line:
C:\Git\My.App.2014>npm start
> MyApp#0.0.1 start C:\Git
> node ./bin/www
C:\Git\My.App.2014>
And instead of running the server, it just stops instantly. Any ideas?

Resources