Npm Start not running node.js, not running scripts - node.js

I am setting up a project with node & express. I am running the same error message.
I've read multiple help articles suggesting to clear the cache and create new .json files. I've also edited the scripts in the package.json file and had no luck clearing the error.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! package#1.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the package#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:

Looks like your script is running node ./bin/www so do you have those folders and index.js file inside the directory?
Share your package.json and maybe it will give more info.

I think you have used express generator to generate boiler code, to to test code in this case.
for macos
DEBUG=yourprojectfoldername:* npm start
for windows
set DEBUG=myapp:* & npm start

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

Npm React js start error - ELIFECYCLE ERRNO1

The system cannot find the path specified.
npm ERR!
code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-able-pro#1.0.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-able-pro#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:
ive got some error when i npm start, it always like this when i restart my pc,
ive already use
npm cache clear --force
deleting my modules app and package-lock.jason
npm install
and its doesnt work at all, can you guys help me ?
The library that you are trying to run is "react-able-pro". Through a search on www.npmjs.com for this library, I was not able to find it. However I was able to find react-table-pro.
It looks like a typo. try to fix your package.json file dependencies/devDependencies and then try to reinstall

Why has my server stopped working after trying to install SCSS?

Currently, I am following a course in React development. As a part of the course, we have to install SCSS to style an e-commerce app. So far, I have tried avoiding SCSS and reformat the code to CSS. However, since there is no $ SCSS equivalent in CSS, I am forced to install SCSS. Nevertheless, after writing
npm add node-sass
I had to restart my server and I got the error stated at the end. In the course, they mention that there might be some bugs and in that case, we should use the following lines
rm -rf npm.lock
rm -rf node_modules
Despite using these lines, my server still will not start and I am still stuck being unable to proceed since I need SCSS to work, and for that, I need my server to work because I need to restart it to install NCSS. In the following lines, I will leave the error message I get when I try to start my server. npm and node are already installed.
aaronserpilin#Aarons-MacBook-Air crown-clothing % npm start
> crown-clothing#0.1.0 start /Users/aaronserpilin/crown-clothing
> react-scripts start
sh: react-scripts: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! crown-clothing#0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the crown-clothing#0.1.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! /Users/aaronserpilin/.npm/_logs/2021-10-02T13_22_23_006Z-debug.log
aaronserpilin#Aarons-MacBook-Air crown-clothing %
what your node-sass version used?
i used node-sass#4.14.1 and react#17.0.0 is work

react-scripts: command not found (npm start)

I've been using create-react-app without issues for some time, but recently, after running it, I cannot start the development server. After running npm start, I get the following error:
sh: react-scripts: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! js-calculator#0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the js-calculator#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Scripts appear to be in the correct location and correctly configured in the package.json file.
Also, npm start throws me the same error if I run it in other react-apps folders that used to work before.
I tried various suggestions I found here on stackoverflow:
installing create-react-app globally;
reinstalling dependencies (npm install);
reinstalling react scripts (npm install react-scripts --save);
updating node and npm;
but none of the above worked.
Any suggestions?
I've also a more detailed .log file, in case anyone wants to have a look at it.
After many tries and more reading of related issues here on SO, I found the cause. One of my react-app parent folders (five levels above) name was "example/example"; naming it to "example-example" solved the problem.

react scripts not found

I have a problem running npm start from my newly created project, the thing is the problem doesn't seem to occur outside of this folder (its a git repo, so it needs to be in here). If i create a new project in another folder and run npm start I have no issues at all.
So I recently started working in Ubuntu 18.04LTS, gone through all the setup of installing nodejs and npm.
Currently running versions:
node = 10.16.0
npm = 6.9.2
So I created my app by using npx create-react-app
When i run npm start inside this, it throws me an error:
sh: 1: react-scripts: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! frontend#0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the frontend#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
I tried create the app in another folder, testing if i can run npm start (yes) and the move this app to my repo, but then it fails again.
If i understand well what you wrote, "npm start" worked fine when you changed folders. If this is the case, you should know that Node has issues reading the path when some particular characters (like "&") or spaces are in the name of a folder.
Try to change the folder's name.

Resources