how do I restart ghost on an ec2 instance - amazon-ec2

I have Ghost running on an EC2 instance and I'd like to restart it after making changes to the source.
I CD'd into the ghost directory and ran the following command
sudo npm restart
I get the following errors
> ghost#0.4.2 start /var/www/ghost
> node index
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:904:11)
at Server._listen2 (net.js:1042:14)
at listen (net.js:1064:10)
at net.js:1146:9
at dns.js:72:18
at process._tickDomainCallback (node.js:459:13)
at process._tickFromSpinner (node.js:390:15)
npm ERR! ghost#0.4.2 start: `node index`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the ghost#0.4.2 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 Linux 3.10.48-55.140.amzn1.i686
npm ERR! command "/usr/local/bin/node" "/usr/bin/npm" "restart"
npm ERR! cwd /var/www/ghost
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/www/ghost/npm-debug.log
npm ERR! not ok code 0
All I've really done is added a them to the themes folder and it's not showing up in the admin settings and I figured restarting ghost would help.

Did you use these instructions? If so you can restart Ghost with:
pm2 restart ghost
In that command ghost is the name of the pm2 process which you can get from
pm2 list

When I received the same error message, I had a node instance running on the same port. Search for the process by sudo ps aux | grep node and kill that node process if possible.

Related

ERR! build error when I tried use a template

I try to use a Vue template, but when I try to run npm install, I get this errors:
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
npm ERR! node-sass#6.0.1 postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#6.0.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I tried deleting node_modules and package-lock.json and re running npm install, but this doesn’t work.

Getting error when running command npm install cypress --save-dev

Getting below error when running command npm install cypress --save-dev
npm ERR! path C:\Windows\system32\cmd.exe;BrowserServers\chromedriver.exe
npm ERR! errno ENOENT
npm ERR! cypress#4.12.1 postinstall: node index.js --exec install
npm ERR! spawn C:\Windows\system32\cmd.exe;BrowserServers\chromedriver.exe ENOENT
npm ERR!
npm ERR! Failed at the cypress#4.12.1 postinstall 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\Admin\AppData\Roaming\npm-cache_logs\2020-08-07T12_33_09_219Z-debug.log
NOTE : Have run npm-init and package.json is created
node -v
v12.18.3
npm -v
6.14.6
also have set NODE_HOME Env variable
check you using Node.js 8 and above

Windows 10 - Failed at the #angular/cli#8.2.2 postinstall script

I cannot get Angular CLI installed on a new Windows 10 machine at all.
I have cleared node cache. I have uninstalled and re-installed node via every method including chocolatey. I have edited the npmrc to change the default location of node modules... everything I can find
$ npm install #angular/cli
#angular/cli#8.2.2 postinstall C:\sandbox\ang\node_modules#angular\cli
node ./bin/postinstall/script.js
npm WARN enoent ENOENT: no such file or directory, open 'C:\sandbox\ang\package.json'
npm WARN ang No description
npm WARN ang No repository field.
npm WARN ang No README data
npm WARN ang No license field.
npm ERR! file C:\Windows\system32\cmd.exe;
npm ERR! path C:\Windows\system32\cmd.exe;
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;
npm ERR! #angular/cli#8.2.2 postinstall: `node ./bin/postinstall/script.js`
npm ERR! spawn C:\Windows\system32\cmd.exe; ENOENT
npm ERR!
npm ERR! Failed at the #angular/cli#8.2.2 postinstall 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\tblaw\AppData\Roaming\npm-cache\_logs\2019-08-16T01_04_13_709Z-debug.log
Do you have the latest node installed? I though I did, but I had separate versions installed via homebrew (which had the latest 12.10), and globally only had 6.5.
Test with node -v and force latest version with nvm install 12.0.0

Sails.js won't install. Windows

Sails.js will not install, but just to make sure npm is working I installed grunt
npm install -g grunt-cli and it installed correctly.
But when I run npm install -g sails I get an error.
Command prompt error:
`sails#0.11.0 preinstall C:\Users\User\AppData\Roaming\npm\node_modules\sails
node ./lib/preinstall_npmcheck.js
Sails.js Installation - Error
Unable to check your npm-version
Please reinstall npm to use Sails.js
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-
cli.js" "-g" "install" "sails"
npm ERR! node v4.0.0
npm ERR! npm v2.14.2
npm ERR! code ELIFECYCLE
npm ERR! sails#0.11.0 preinstall: node ./lib/preinstall_npmcheck.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sails#0.11.0 preinstall script 'node ./lib/preinstall_npmcheck.js'.
npm ERR! This is most likely a problem with the sails package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./lib/preinstall_npmcheck.js
npm ERR! You can get their info via:
npm ERR! npm owner ls sails
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log`
npm-debug.log:
https://gist.github.com/anonymous/c850ac8c71e0410db020
I got the same errors.
npm -g install sails
But it worked when I ran command line as administrator.
I solved this by running npm install -g sails --ignore-scripts.
The only thing I can think of is for some reason I don't have ./lib/preinstall_npmcheck.js file and it is trying to run it, so by ignoring it I don't get the error, hence the successful install.
I still don't understand why, but I hope this helps someone.

Web starter kit installation Error

when i run the installation process and put npm install in the command line after running some processes it gives me this :
npm ERR! safefs#3.0.6 preinstall: `node ./cyclic.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the safefs#3.0.6 preinstall script.
npm ERR! This is most likely a problem with the safefs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./cyclic.js
npm ERR! You can get their info via:
npm ERR! npm owner ls safefs
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\Class Talkies\Desktop\www\web-starter-kit-master
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! syscall spawn
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! not ok code 0
I also got a few errors upon installing via the npm install command, but in order to get it to go away I relaunched command prompt in administrator mode. It solved the problem easily.
Hope it helps!

Resources