npm start not working for my NodeJs project - node.js

Anyone can please help i'm stuck in npm start command
I'm working on node js with typescript - Running Platform Windows 7-64
but it won't start throwing errors
HERE You Can check Files
Log File,package.json,Error Image : https://filebin.net/oebfwc7nln660exp
\NODEJS\project2>npm start
project2#1.0.0 start \NODEJS\project2
nodemon --exec ts-node src/index.ts
Node.js is only supported on Windows 8.1, Windows Server 2012 R2, or higher.
Setting the NODE_SKIP_PLATFORM_CHECK environment variable to 1 skips this
check, but Node.js might not execute correctly. Any issues encountered on
unsupported platforms will not be fixed.npm ERR! code ELIFECYCLE
npm ERR! errno 216
npm ERR! project2#1.0.0 start: nodemon --exec ts-node src/index.ts
npm ERR! Exit status 216
npm ERR!
npm ERR! Failed at the project2#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2020-08-28T19_00_00_536Z-debug.log

After setting NODE_SKIP_PLATFORM_CHECK in environment variables with value 1 it worked on Windows 7.

Related

Nestjs failed to deploy on cpanel

I'm trying to deploy my backend application on cpanel and I'm getting an error like this
what should i do to solve this problem?
> test3#0.0.1 start /home/nandaken/inventory
> nest start
stderr:
npm WARN lifecycle The node binary used for scripts is /home/nandaken/nodevenv/inventory/12/bin/node but npm is using /opt/alt/alt-nodejs12/root/usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
sh: nest: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! test3#0.0.1 start: `nest start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the test3#0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/nandaken/.npm/_logs/2023-01-28T08_16_43_494Z-debug.log
Looks like cpanel is calling the startscript which is running nest start. More than likely, you only have production dependencies installed, so #nestjs/cli isn't installed because it is a devDependency. Either configure cpanel to call a different start script (like start:prod which should map to node dist/main) or change your start script to run the proper js file (like node dist/main). The other option would be to install #nestjs/cli as a production dependency, but I wouldn't suggest that

NextJS not running on MacOS even after installing modules

So I've just created a NextJS project using create-next-app which went smoothly as expected. Then ran npm i just to be sure and saw all modules installed into node_modules
When I try to run npm run dev to start my nextjs app. it just says
sh: next: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! test#0.1.0 dev: `next dev`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the test#0.1.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/john.v.n.pakson/.npm/_logs/2022-10-06T08_01_29_725Z-debug.log
It seems like npm is not detecting the node_modules i have installed.
Not sure if this is a mac or a zsh issue.
I'm using node version 12.22.12
Upgraded to 16.17.1 and still see the same error
> test#0.1.0 dev
> next dev
/var/folders/6y/xtlzp4z16dj0stxnqx8znj8w0000gn/T/dev-01c08137.sh: line 1: next: command not found
Okay I figured it out. It was caused by my file path on macos. My project was on a folder called Project/Test which might have confused zsh or mac. This in turn caused npm to not be able to find the correct scripts on my node_modules
When I moved my project to another folder I was already able to run npm run dev properly.
Cheers!

Problem starting Electron app - [603:0827/215406.435140:FATAL:electron_main_delegate.cc(264)] Running as root without --no-sandbox is not supported

I am trying to set up a electron project. I have followed this tutorial and the previous ones.
But when I get to "Running your App" and type npm start, I get the following message:
myApp#1.0.0 start ***PATH***
electron .
[603:0827/215406.435140:FATAL:electron_main_delegate.cc(264)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
***PATH***/node_modules/electron/dist/electron exited with signal SIGTRAP
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myApp#1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myApp#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/tobias/.npm/_logs/2020-08-27T11_54_06_541Z-debug.log
npm version: 6.14.6
node.js version: 12.18.3
I'm using the WSL terminal in Visual Studio code.
I have tried installing the electron-quick-start package with the same outcome.
I don't know if it helps but in your package.json try changing the start script into
"start": "electron --no-sandbox ."

Can't start react native project with npm start

First i started with installing npm (version ) then expo cli (version ) then i initialise a project normaly then when i start my project with npm start and also expo start a get this message :
Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
ConfigError: Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
at Object.getExpoSDKVersion (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Project.ts:22:9)
at ensureConfigHasDefaultValues (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:419:22)
at fillAndReturnConfig (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:101:10)
at getConfig (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:137:10)
at configureProjectAsync (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:288:25)
at action (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:164:34)
at C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:341:16
at Command.<anonymous> (C:\Users\BILAL\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:82:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: expo start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\BILAL\AppData\Roaming\npm-cache_logs\2020-05-17T00_34_22_028Z-debug.log
also i worked with react native and react-cli before for a simple app and it worked but this time i tried for a week without result
thank you so much

Expo project not starting

My expo project doesn't start when I try to use npm start.
Versions that I am using are
Expo-cli: 3.20.5
Node : 12.16.3
Flow:
expo init project
-> blank template
expo start
After running the expo start command it gives the following error
Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
ConfigError: Cannot determine which native SDK version your project uses because the module `expo` is not installed. Please install it with `yarn add expo` and try again.
at Object.getExpoSDKVersion (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Project.ts:35:9)
at ensureConfigHasDefaultValues (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:419:22)
at fillAndReturnConfig (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\config\src\Config.ts:101:10)
at configureProjectAsync (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:281:25)
at action (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:157:34)
at C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:334:16
at Command.<anonymous> (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:85:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
Then as mentioned in the above first line I ran npm install expo
After running the command for installing expo it gives me the following error
Error: React Native is not installed. Please run `npm install` in your project directory.
Couldn't start project. Please fix the errors and restart the project.
at startExpoServerAsync (C:\#expo\xdl#57.9.5\src\Project.ts:2080:11)
at Object.startAsync (C:\#expo\xdl#57.9.5\src\Project.ts:2397:5)
at action (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:170:3)
at C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\commands\start.ts:341:16
at Command.<anonymous> (C:\Users\Talha\AppData\Roaming\npm\node_modules\expo-cli\src\exp.ts:85:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: `expo start`
npm ERR! Exit status 1
npm ERR! Failed at the # start script.
Then I ran npm install mentioned in the above error but then got this error
npm WARN deprecated deep-assign#3.0.0: Check out `lodash.merge` or `merge-options` instead.
npm WARN deprecated core-js#1.2.7: core-js#<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js#3.
npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file
after that when i again try to npm start it keeps repeating itself through the same errors I mentioned above
the problem is that npm install is not working on your machine, possibly due to some cache issues. you can run npm cache clean --force and then npm install again to try to resolve the issue
Illustration I had the same issue and cleaned up my node module. But the issue came back because I kill my server the wrong way. So I cleaned the repo again and close my server properly. And now I all the time close correctly my server. The issue didn't happen again for the moment.
=> Don't kill your cmd, you have to close the server correctly by doing CMD+C for win 10.

Resources