I just created a new application using JHipster on Windows. I can run it just fine using "mvn spring-boot:run". However, I would like to get auto-reloading of pages and so would like to use "grunt serve". When I run it, it starts fine. But when I go to "http://localhost:3000/" in Chrome it just sits there waiting for the server to connect. I can go to http://localhost:3001/ just fine and see BrowserSync but there are not any servers listed under the "Current Connections" section.
Here is the out put I see after running "grunt serve":
C:\mydev\pmi>grunt serve
Running "clean:server" (clean) task
>> 0 paths cleaned.
Running "wiredep:app" (wiredep) task
Running "wiredep:test" (wiredep) task
Running "ngconstant:dev" (ngconstant) task
Creating module pmiApp at src/main/webapp/scripts/app/app.constants.js...OK
Running "concurrent:server" (concurrent) task
Running "browserSync:dev" (browserSync) task
[BS] [info] Proxying: http://localhost:8080
[BS] Access URLs:
--------------------------------------
Local: http://localhost:3000
External: http://10.255.247.72:3000
--------------------------------------
UI: http://localhost:3001
UI External: http://10.255.247.72:3001
--------------------------------------
[BS] Watching files...
Running "watch" task
Waiting...
I just never see anything in the browser (neither Chrome nor Firefox connect).
I saw another post suggesting that I delete my node-modules directory and reinstall use "npm install". I did that and got the same result.
I've been looking at it for an hour and a half tonight. Last night, something finally triggered and it started working. But I'm getting the same problem tonight. I don't know what finally got it working last night. I had been having the same problem for an hour last night.
I'm stumped.
You're not the only one :). I was having trouble with this as well.
Just to clarify. You need to run both
'mvn spring-boot:run'
and
'grunt serve'
D'oh
I was under the mistaken assumption that 'grunt serve' did the same thing (only better) as "mvn spring-boot:run". Not so.
"mvn spring-boot:run" runs the backend web server and handles the REST endpoints.
'grunt serve' handles the front end angularJS side of things.
Looking back at the documentation it is now obvious.
What a Noob.
If you are using gradle you can run this:
./gradlew bootRun
In my case the message bellow informs that you can access the spring application:
> Building 85% > :bootRun
After that you can run this:
grunt serve
The message "Running "watch" task Waiting..." will appear in the console, but
the browser will open automatically and show the address bellow:
http://localhost:3000/#/
Related
I am a newbie in web development. I have installed Meteor on ubuntu. When I try to create an app using something like:
Meteor create my-app
It creates the my-app folder but it never returns out of "Installing npm dependencies". I have been waiting for more than half and hour. I was wondering if this is normal? How long more should I wait for it to end?
I'm working behind a company proxy but I have set the proxy using the following lines (and that allowed me to install Meteor in the first place):
export http_proxy=http://username:password#proxy:port
export https_proxy=http://username:password#proxy:port
I was stuck in a similar situation on Windows.
Cancel the job using ctrl+c. Since meteor creates the app directory even before the command is complete, you will have the directory intact, go into the directory and run
meteor npm install
It will install all the dependencies (took 7s for me),
then run meteor to start the server.
I'm trying to launch a SailsJS server via PM2 and watch for changes i'm using:
pm2 start app.js --watch -x -- --verbose
Note no SUDO before so it should launch as the right user, I'm getting all kinds of odd Grunt errors though all with error code EACCES.
I've even tried running it with -u root which gets rid of of the errors but I still get EACCES error after a source update.
I'm guessing maybe the grunt tasks are getting run with a different user somehow?
I am following the installation guidelines as described on mean.js.org Everything seemed to install fine. I have all prereqs installed. I ran npm install after cloning the github repo and then tried to run grunt and I didnt get any errors however It seems to just be stalling on the command line. Last message on the command line is the "debugger is running on port 5858" and then it just sits there.
After some time the message [nodemon] watching 51,839 files - this might cause high cpu usage. To reduce use "--watch" comes up. I am on windows 10 and have all the latest versions of node,npm,grunt and mean.js. I am running the command line as admin.
Mean.js should be running on localhost:3000 but it is not.
This is intended.
There is an application invoked by the grunt command and running in background, watching your files for changes. In default configuration: nodemon and grunt-watch.
This will execute specific tasks based on the files you edited, such as linting JS files or compiling LESS files.
The cmd will probably show something when you edit files in the projects directory.
I am trying to get my localhost working on my remote (mediatemple) server.
I have bundled it up and have a /myurl.com/bundle folder with the following files.
this folder contains
main.js
npm-debug.log
programs
server
How do I get this to run?
You should take a look in the README inside the bundle folder. Normally everything ist described there to start your app.
Make sure that NODEJS and MONGO is installed on your remote server. This is NOT included in your bundle as well as NODEJS is not present.
If you are running a system like debian or ubuntu normally you can do the installation with
apt-get install nodejs mongo
Make sure, that the nodejs has release v0.10.36 or v0.10.38
node --version
At the README you see the necessary ENV-VARS like MONGO_URL and PORT you need to set to start your meteor app.
If you have running a apache server already the PORT 80 is already blocked, so try PORT=3000 to start your meteor app.
Example:
MONGO_URL='mongodb://localhost:27017/yourapp' ROOT_URL="http://yourhost" PORT=3000 node main.js
If using as above you do not need to export the ENV-VARS before start
Sometime when starting, there are missing NPM – you get fiber errors
In that case
cd programs/server
npm install
and the try start again.
Good luck
Tom
(I'm writing this response assuming that you are not worried about scalability issue, respond in comment if you want to scale your app)
The best option for running a node application, which Meteor application is, is by using forever.
npm install forever
forever start simple-server.js
If you want to figure out how to see the log files and how to stop/restart your service, you can run forever --help to see all the commands.
I am running karma with grunt and I am using the advice from the karma-runner page how to configure it to watch on changed files:
Config your watch task to run the karma task with the :run flag. For example:
...
In your terminal window run $ grunt karma:unit:start watch,
tests are run and everything is fine except for the fact that karma starts reporting in the console in teamcity format (and I have it nowhere in the settings or dependencies) and insists on using PhantomJs regardless what settings I put in the browser array.
What could be causing that behavior?
It turned out the problem is missing explicit port value in the karma conf