DiscordJS, Gulp reload bot on file save? - gulp

I just started messing around with Discordjs and I'm working on just a super simple bot example, but the most annoying thing is whenever I make any changes I need to stop the bot in command line and execute the command to come back online in order for any of my code changes to take affect. Is there any way to automate this process? lets say I make a change to bot.js, would there be a way for something like gulp to detect this and restart the bot?

You could use something like nodemon (http://nodemon.io/).
Install it by running: npm install -g nodemon. This will install it globally on your computer. Then just run nodemon on the console instead of node myfilehere.js.
Make sure the file you are running with node myfilehere.js is the same name on package.json under "main"

Related

Why is shadow-cljs returning this error message on "Stale Output"? How to guarantee the watch for this building is running?

I am new to Clojure and not a pro in Javascript. I am watching the free part of the course on Reagent.
Following the instructions on the course's repo, after doing the git clone and the npm install, the author indicates running $ npm run dev. Everything seems to work fine. I can see the app on my http://localhost:3000/.
The favicon with the app's logo and its name is loaded on the corner of the browser's tab:
However, on the bottom of the web page, there is this error message from shadow-cljs:
shadow-cljs - Stale Output! Your loaded JS was not produced by the
running shadow-cljs instance. Is the watch for this build running?
Why is this happening? How should I fix it?
How to guarantee that the watch for this building is running?
Is there a simple command to run on terminal to check this?
Obs. 1: If this is relevant, my operational system is NixOS and this is my config file.
Obs. 2: I am not sure if this question is connected to my previous question on npm and Cider (Emacs IDE for Clojure) that happened while working with this same repo.
It is likely that this is due to you running npm run dev AND cider-jack-in.
I don't use emacs, so I'm not exactly sure what cider-jack-in does, but I believe it launches a new JVM. Since the npm run dev also did that you end up with two running JVMs, which also means two running shadow-cljs instances. That is not ideal and they will start interfering with each other leading to errors such as yours.
So, either you run npm run dev and use emacs to connect to that server. cider-connect or whatever is called should do that.
Or you don't run npm run dev at all and instead only cider-jack-in and then start the watch from the REPL.
Don't forget to first kill all java processes that might be running for that project. As long as there is more than one shadow-cljs process running for the project things will be weird.
This happens to me when I clicked on the build link BEFORE it has compiled. In which case, the link is displaying a previously compiled version, not the live version, and "watch" on code changes doesn't work either. Just wait for your terminal output to say "compiled" before clicking on the link.

Trying to install Moralis-admin-cli

I am trying to install the "moralis-admin-cli" program to make my account and I have to add it the path that the Terminal gave me so it will download in the proper directory.
I did have a problem where the cursor was but that has been overcome.
So when I type in the code as the tutorial tells this how the tutorial shows how to do it and this is the error:
C:\metadata-static-app>npm install -g moralis-admin-cli
'npm' is not recognized as an internal command, operable program or batch file.
I just need to find a way to install this moralis program in the "metadata-static-app" directory on my computer so I can move on to the next step.
Can you help me.
Add node.js on your environment, the npm command will work!

Why does change my mix-manifest file when i run npm run dev code?

When i run this code npm run dev in my Laravel+Vue.js project it changing my mix-manifest.json file. I dont want this. What can i do?
I want to add static values to mix-manifest.json or dynamic values.
You shouldn't edit this file. It is automatically regenerated when you run npm run dev. Think about other solution.

json file location in command prompt

I am trying angularjs-2 for the first time from the example found here
and everything was working fine until I came to a point where the author has written something like this
Now open the package.json file location in command prompt and execute
the below command to load the required modules and supported files
which are mentioned in the package.json file.
npm start
after reading this I open command prompt by pressing window+R and write cmd
and I enter the following path
E:....\nodejs with angular2 testing\nodejs with
angularjs2\nodejs with angularjs2\
but i am not able to do anything after this point
how can i execute the package from command prompt,?
i tried the same with developer command promt but facing the same issue,
hey guys i know i am bad in english but please i need help here
First you need to have nodejs in your system.
If you don't have nodejs, then download it. which shifts npm with it. [It is similar kind of stuff what nuget does in VisualStudio.]
As you mentioned package.json is already there in your project then you need to got to you Application folder in command prompt to install packages by running npm install.
For example : If your App folder is in E:\Project\Myangular2App,
then after opening Command Prompt with window+R, navigate to E drive by E:, then navigate to your App folder by cd Project\Myangular2App and run npm install. This will install all the packages mentioned in package.json
start seems to be a script configured in your package.json which probably runs something else.
Please state if npm (the node package manager) runs on your CLI without any argument. If not you have to get npm working first. It has to be in your $PATH variable in order to function anywhere.

Hudson .jelly files edit not reflected

I edited a few .jelly files for Hudson, but it's not reflected. How do I restart Hudson ? I hope that this will display the HTML tag changes made in the .jelly files.
I am trying to change the look and feel of the Hudson.
On what OS do you run Hudson? How did you install Hudson? .....
The basic idea is to stop Hudson (or just kill it) and than start it the same way it was started before. If you are not the person who installed it, call the person. After a while they get tired of you asking and will give you the instructions (and also the permissions) to do it yourself. ;)
If you have create plugin with mvn -U org.jenkins-ci.tools:maven-hpi-plugin:create command.
This will have in built Hudson.
You can run mvn hpi:run at location of plugin.
You can debug using mvnDebug hpi:run.
mvnDebug by default uses 8000 port,if you are using eclipse as IDE, Go to Run -> open Debug Config -> Select plugin and port and start debug. This will do remote debugging on 8000 port.