So I've been trying to create a server for dynamic web pages using Openshift, so I created a bare-bones node.js/Express template just for connecting to Index.html (to test the code) but when I try and run the code Openshift goes into a crash loop back-off.
Note: I'm new to Node.js and back-end development in general so please be thorough with your answers.
The Openshift error log:
Environment:
DEV_MODE=false
NODE_ENV=production
DEBUG_PORT=5858
Launching via npm...
npm info it worked if it ends with ok
npm info using npm#3.10.9
npm info using node#v6.11.3
npm ERR! Linux 3.10.0-693.15.2.el7.x86_64
npm ERR! argv "/opt/rh/rh-nodejs6/root/usr/bin/node" "/opt/rh/rh-nodejs6/root/usr/bin/npm" "run" "-d" "start"
npm ERR! node v6.11.3
npm ERR! npm v3.10.9
npm ERR! path /opt/app-root/src/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/opt/app-root/src/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '/opt/app-root/src/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /opt/app-root/src/npm-debug.log
The github repo:
https://github.com/TrueAmbition001/TrueAmbition001.github.io
Thanks in advance.
The Node.js S2I builder requires the package.json and application code to be in the root directory of the repo, you have it in a sub directory. So the structure of your code doesn't match what is required.
For some details on the S2I builder for Node.js, see:
https://github.com/sclorg/s2i-nodejs-container/tree/master/8
Related
D:\react> npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\react/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\react\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Dell\AppData\Local\npm-cache_logs\2023-02-04T06_09_25_519Z-debug.log
I am a beginner , I have my node installed in C: drive but I Want to create a react project in D: drive . project was created but when I ran 'npm start' it gave me Error.
npm ERR! This is related to npm not being able to find a file.
Opened command prompt as an administrator and and changed my directories to d drive and reached to my folder . then created project and ran " npm start " from command prompt .it worked . so just I had to open project as an administrator.
follow below steps :
C:\Windows\system32>cd..
C:\Windows>cd..
C:\>d:
D:\>cd react
D:\react>npx create-react-app my-app
your project will be created. then go to project folder
D:\react>cd my-app
D:\react\my-app>npm start
// plz don't type above quotation mark.
now my project ran into the browser. I Hope it helps to others as well.
I want to start using react , so I first installed node in my windows via command prompt , and then installed react using npx create-react-app ... , and later in vs code terminal when I write npm run start I get the following error, I searched a lot but didnt find a way.
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\LENOVO\Desktop\React/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\LENOVO\Desktop\React\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\LENOVO\AppData\Local\npm-cache\_logs\2021-11-27T19_22_54_184Z-debug.log
First move into the Desktop/React/ Folder then do :npm start
After creating react project a new folder named your project is created. You first to go there using cd /folder name. Then do npm start.
You just need to use "npm start" in the terminal.
PS C:\Users\USER\Desktop\react> npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\USER\Desktop\react\package.json
npm ERR! errno -4058
'C:\Users\USER\Desktop\react\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\USER\AppData\Roaming\npm-cache_logs\2020-10-15T10_23_32_090Z-debug.log
It looks like you're trying to run an npm script such as "npm start" in a folder that doesn't have a "package.json" file. Make sure you are in your React project's working directory and try again.
Why am I getting the following error when I run npm start in react?
C:\Users\ave\geekyShows>npm start
npm ERR! path C:\Users\ave\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\ave\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ave\AppData\Roaming\npm-cache\_logs\2020-01-12T09_04_26_349Z-debug.log
The directory you're currently trying to run doesn't have a package.json file. Maybe you're outside of the project that you just created. Happens to me most of the time when I'm working in hurry. :D
You can just enter inside your project directory that has package.json file like so (Assuming your project name as geekyShows):
cd geekyShows
npm run start
Hope this helps.
I have node v7.10.1 and npm v4.2.0 installed on my ubuntu 16.04 os. When I run start npm or sudo start npm I get the below error. It was working this morning now I am getting errors. Please assist
npm ERR! Linux 4.10.0-32-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v7.10.1
npm ERR! npm v4.2.0
npm ERR! path /home/dombo/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open
'/home/dombo/package.json'
npm ERR! enoent ENOENT: no such file or directory, open '
/home/dombo/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /home/dombo/.npm/_logs/2017-08-18T20_04_33_148Z-debug.log
The problem is that npm can't find your package.json. Be sure that file exists, and you are in the same directory before running npm start.
Make sure that /home/dombo/package.json file exists. It is possible that you are in the wrong directory.