Error starting NPM .. Ghost Blog .. error npm start - node.js

********** Update *********
This had to do with me changing my ports to those of my ipaddress in config.js so I can test on mobile and table. Any idea how I can do this without changing the ports everytime I reboot the computer so that they are always set to my ipaddress for testing?
**********Original Question ****
I am getting a strange error when starting npm to run my ghost blog. It has happened before and I went back to a previous commit on github. It seems like everytime I get it working through a different method and then stop working and close terminal. Then when I restart its another issues?? Maybe github is causing it. Any help would be great. Tried everything I know how to do.
here is the error message:
cconti77#Charless-iMac ~/sites/_repos/elite-university (get-back-on-it●●●)$ npm start
ghost#0.5.0 start /Users/cconti77/Sites/_repos/elite-university
node index
Migrations: Up to date at version 003
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRNOTAVAIL
at errnoException (net.js:904:11)
at Server._listen2 (net.js:1023:19)
at listen (net.js:1064:10)
at net.js:1146:9
at dns.js:72:18
at process._tickCallback (node.js:419:13)
at process._tickFromSpinner (node.js:394:15)
npm ERR! ghost#0.5.0 start: `node index`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the ghost#0.5.0 start script.
npm ERR! This is most likely a problem with the ghost package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node index
npm ERR! You can get their info via:
npm ERR! npm owner ls ghost
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.4.0
npm ERR! command "node" "/usr/local/bin/npm" "start"
npm ERR! cwd /Users/cconti77/Sites/_repos/elite-university
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/cconti77/Sites/_repos/elite-university/npm-debug.log
npm ERR! not ok code 0

You are already using the Ghost port for something else.
Most probably ghost exited the wrong way, or you are using forever/pm2 and the process hasn't closed properly. try killing any 'forever/pm2' instances, then reboot your machine. Worked for me.
To understand what happens, I suggest you try the following to see which process uses the ghost port, then kill the process. http://www.cyberciti.biz/faq/what-process-has-open-linux-port/
And also, you're a bit off-topic, this should be moved to SuperUser.

Related

simple react works with npm start but not with nohup npm start &

I tested with a simple app generated by
npx create-react-app myfirstreact
It works fine with
npm start
but if I try to run it in the background with
nohup npm start &
I get
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: EBADF: bad file descriptor, read Emitted 'error' event at:
at lazyFs.read (internal/fs/streams.js:165:12)
at FSReqWrap.wrapper [as oncomplete] (fs.js:467:17) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! myfirstreact#0.1.0 start:
react-scripts start npm ERR! Exit status 1 npm ERR! npm ERR! Failed
at the myfirstreact#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!
/home/jglickman/.npm/_logs/2020-10-06T04_43_39_480Z-debug.log
Try running it like this:
nohup node scripts/start.js
I think this post will help too.

Mongodb EHOSTUNREACH on Openshift Online 3 starter

I was working on my Openshift app today and without changing anything related to mongodb connection I started getting this message:
/opt/app-root/src/node_modules/mongodb/lib/server.js:242
process.nextTick(function() { throw err; })
^
Error: connect EHOSTUNREACH 172.30.173.215:27017
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14)
npm info lifecycle bolao_2018#0.1.0~start: Failed to exec start script
npm ERR! Linux 3.10.0-693.21.1.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! code ELIFECYCLE
npm ERR! bolao_2018#0.1.0 start: `node main`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bolao_2018#0.1.0 start script 'node main'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the bolao_2018 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node main
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bolao_2018
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bolao_2018
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /opt/app-root/src/npm-debug.log
The one thing different was that I saw that for some reason the mongodb service tried and failed a new deploy so I ran one manually.
I also noticed that the IP addressit tries to connect is mongodb's cluster IP but the Node IP of the current running pod is different.
Can someone help me figure out what triggered the connection to break?
Thanks
From within a given Project scope, requests directed toward a hostname of "mongodb" should be routed to the Kubernetes Service named "mongodb" (when available).
To debug this connectivity issue:
Try opening a live terminal within your front-end container using the OpenShift web console. The front-end container must be within the same Project scope as the database service
Type env to list environment variables available to the front-end. If this container was started after the creation of the "mongodb" service, configuration strings should be visible the environment
Run curl $MONGODB_SERVICE_HOST:$MONGODB_SERVICE_PORT from the live terminal to verify the availability of the mongodb service

Laravel-mix - BrowserSync throwing an error at event.js:160

Not sure if the problem is related to laravel-mix, but I am having problem with Browsersync package. Here is my mix.js:
mix.js('resources/assets/js/app.js', 'public/js')
.browserSync({proxy: 'localhost:8000'})
.sass('resources/assets/sass/app.scss', 'public/css');
When I run npm run watch-poll ( watch doesn't pick up the changes, hence the watch-poll see here ) I get the following error on the console:
[Browsersync] Watching files...
events.js:160
throw er; // Unhandled 'error' event
^
Error: watch resources/views/auth/passwords ENOSPC
at exports._errnoException (util.js:1020:11)
at FSWatcher.start (fs.js:1443:19)
at Object.fs.watch (fs.js:1470:11)
at createFsWatchInstance (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleDir (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:407:19)
at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:455:19)
at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:460:16)
at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch-poll"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch 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/tanmay/.npm/_logs/2017-08-07T07_02_31_677Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch-poll: `npm run watch -- --watch-poll`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch-poll 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/tanmay/.npm/_logs/2017-08-07T07_02_31_725Z-debug.log
I am on: Ubuntu 16.04.3 (Not a VM). Running: Nodejs v6.11.2, NPM v5.3.0
When I comment out the .browserSync() call from my mix.js:
mix.js('resources/assets/js/app.js', 'public/js')
// .browserSync({proxy: 'localhost:8000'})
.sass('resources/assets/sass/app.scss', 'public/css');
however, the error no longer persists. How do I get around the problem? Please feel free to ask any other necessary information.
Here is my package.json file
UPDATE: This error doesn't occur on a new laravel project. To get the same result as a new project, this is what I did:
I removed the node modules: rm -rf node_modules I removed the package-lock.json file: rm package-lock.json I re-run: npm install, npm run dev, npm run watch-poll
Result: still same error :(
This might be due to another task running on port 4040 already.
You can try killall -9 node
Source/more details: https://github.com/parse-community/parse-dashboard/issues/401#issuecomment-224007436
I suspect it's the same problem that is shown & with working solution from Gulp Error: watch ENOSPC
Try this: Why this issue occured? There is the limit in the number of
files that can be watched in a system. We have to increase this
number. The below command can be used to increase this number.
$ echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Angular2 Quickstart lite-server crashes

Good Morning people from the Internet,
Intro
While following the Angular2 Quickstart guide I have experienced many times issues where lite-server would crash just after executing npm start. Crash would look like this in your terminal:
ERR! Linux 3.19.0-51-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "lite"
npm ERR! node v5.7.0
npm ERR! npm
v3.8.2
npm ERR! code ELIFECYCLE
npm ERR! angular2-quickstart#1.0.0 lite: `lite-server`
npm ERR!
Exit status 1
npm ERR!
npm ERR! Failed at the angular2-quickstart#1.0.0 lite script 'lite-server'.
npm
ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular2-quickstart package,
npm ERR! not with npm itself.
npm ERR!
Tell the author that this fails on your system:
npm ERR! lite-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular2-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/oscar/dev/cw/npm-debug.log
Most common reasons (and solutions)
Most of the time the reason was one of the two:
lite-server was not shutdown properly. Solution: Killing all npm / node instances and restarting the server with npm start would do the trick.
dependencies are not up to date. Solution: simply deleting the node_modules directory, executing npm install to rebuild the dependencies would do the trick.
Other issue
However when reaching the step called 6.Routing the issue was a bit different. This time instead of crashing straightaway it was failing after typescript compilation:
16.03.15 16:33:49 200 GET /index.html
events.js:154
throw er; // Unhandled 'error' event
^
Error: watch node_modules/angular2/es6/prod/examples/platform/dom/debug/ts/debug_element_view_listener ENOSPC
at exports._errnoException (util.js:856:11)
...
at FSReqWrap.oncomplete (fs.js:82:15)
I have found the cause of the crash. And I felt like sharing the path so it might help others because there are many forum / stackoverflow threads around the same sort of issue but none solved this crash.
Basically, I looked at the stack trace to find which "module" was failing. Here it is
at FSReqWrap.oncomplete (fs.js:82:15)
and the solution was to execute the following command (see this ticket):
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
but instead of just executing it, I needed to understand why setting to 524288 the config item fs.inotify.max_user_watches into /etc/sysctl.conf which is after a system file. I found the answer here where it says and I quote:
Nodejs would report an error if there's too many files for watching due to system limitation, on Linux you can change that by adding fs.inotify.max_user_watches = 524288 to the file etc/sysctl.conf and restart the process
Hope it helps.

Heroku Node Stormpath

UPDATE
I uploaded this to Azure and it worked immediately - I believe the issue had something to do with the .env file but I cannot be sure.
So I followed the guide here:
and am trying to push the app to Heroku. I have all my config vars correct - however, when the application launches on heroku I receive:
/app/node_modules/stormpath/lib/ds/RequestExecutor.js:59
npm ERR! VisualVMail#0.0.1 start: `node ./bin/www`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the VisualVMail#0.0.1 start script.
npm ERR! This is most likely a problem with the VisualVMail package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get their info via:
npm ERR! npm owner ls VisualVMail
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.8.11-ec2
npm ERR! command "/app/vendor/node/bin/node" "/app/vendor/node/bin/npm" "st
npm ERR! cwd /app
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /app/npm-debug.log
npm ERR! not ok code 0
throw new Error('request.uri field is required.');
Has anyone been able to get Stormpath / nodejs / heroku running, particularly with this sample application?
It looks like you have an issue with the VisualVMail package -- can you try debugging that? It says in the error that request.uri is required.
The error "request.uri field is required" is from the stormpath library. It would be helpful to see the stacktrace, can you look for it in /app/npm-debug.log? It may be in your heroku logs as well.
If, more recently you used the Stormpath automatic add-on - This is an issue with the way Heroku have setup their integrations with Stormpath (or vice-versa). I've sent them a bug report.
In your Heroku Settings > Config Variables; if you have a variable named STORMPATH_URL, remove it and add a new variable called STORMPATH_APPLICATION_HREF with its value as your application's href, e.g. https://api.stormpath.com/v1/applications/<appIDhere>.
Then it should work.
Or in the case of your env file, STORMPATH_APP_HREF should be STORMPATH_APPLICATION_HREF.

Resources