Bootstrap: Can't get grunt to run the server - javascript

I downloaded the source code from getbootstrap.com and ran npm install, then grunt connect without any luck.
I see this in my terminal:
Running "connect:server" (connect) task
Started connect web server on 0.0.0.0:3000
But when I navigate over, all I see is this:
What have I missed? I feel I've missed something basic here but unsure why I'm not seeing anything at all?

In the Internet Protocol version 4 the address 0.0.0.0 is a non-routable meta-address used to designate an invalid, unknown or non applicable target.

Unfortunately,bootstrap doc is not build in grunt, you need to install Jekyll to run the web local.so you need install ruby first,and install gem second,then install jekyll,finally,use
jekyll serve
to run the local server.
watch the guide

Related

How to deploy Laravel + Nuxt application?

I have built Web application using Laravel As API and Nuxt As Front and. These 2 built desperately. When the development ongoing Its isn't an issue. Because i can run them using their own development servers. Then i have bought a VPS server for host this. Now the question in how i deploy these two apps on my VPS. Specially How i can deploy nuxt app correctly in vps. Its not static side. It is ssr app.
Essentially, you are going to need a few things:
A server (which you already have)
nginx
PM2
Node/NPM installed
The tricky part of this, is to make sure the server continues running and auto-restarts in case of a crash. PM2 solves that issue, and you can read more information on how to use it here: https://nuxtjs.org/docs/2.x/deployment/deployment-pm2
You can install it by:
npm install -g pm2
Which will install PM2 globally on your server and you'll have access to the pm2 command.
Follow the documentation above, and all you gotta do is run:
pm2 start all
This will start the Nuxt service and it will run on whichever port you've defined on your nuxt.config.js or package.json files.
Now that you've got your Nuxt instance running, you need to make sure that requests that come through the browser end up on the port that Nuxt is running on, that's achievable by using nginx's reverse proxy feature that you can read more about:
https://nuxtjs.org/docs/2.x/deployment/nginx-proxy/
That documentation provides you with an example of an nginx config file, and you shouldn't really have to change anything other than the server_name, and the proxy_pass in case you've changed the default Nuxt port from 3000 to something else.
Additionally make sure that you have allowed port 80 to be listen on your server.

How to deploy angular 7 project directly to my webserver, so that i shouldn't migrate my dist folder always after deployment?

Currently, I am deploying my Angular 7 Project by using FileZilla to migrate my local files from ./dist folder to server public_HTMl. This is a quite tides job to carry in a daily basis, so I want to deploy my code directly to the server, when I hit ng build --prod then those compiled files have to be migrated directly to the server. Do anybody here who can help me to solve this problem?
To get rid of this problem I have tried lots of steps:
I was using bitbucket pipelines to execute my code, it came to be costly and I cannot run it as well, It took several hours but cannot give output for me.
I also tried by using new Git Repository even it's a good way but cannot give me the solution because when I deploy my code locally it creates a new folder every time while I execute a command.
So, I want to get help and deploy this code directly to the server that is going to host my application. Thank you all and hope all of you provide me good tips regarding this problem.
You can do it in the simple way. Create basic bash/sh script or windows executable and use rsync to do this automatically:
deploy.sh:
#!/bin/bash
ng build --prod
rsync -arvt ./dist remoteuser#remotehost:/var/www/remotedirectory
To avoid entering login and password every time add RSA public key to your remote machine(trusted host). You can combine this solution with Bitbucket pipelines, when the free plan ends I run this script manually from my developer machine.
bitbucket-pipelines.yml:
image: mycustomimage:latest
pipelines:
default:
- step:
name: Build and deploy to production
caches:
- node
deployment: production
script:
- npm install
- npm install -g #angular/cli
- ng config -g cli.warnings.versionMismatch false
- ./deploy.sh
Instead of a simple script you can use some more complex solution like Capistrano, Shipit or some other more advanced tool. All depends on your needs...
The simplest solution is always the best :)

How do I run a copied project in Node.js

https://github.com/gleitz/mahjong
I want to run this app on my windows,
the directions say:
-Install dependencies with npm update
-Start the application with node app.js
it's sound easy so I try myself.
1.Fist of all , I install node.js on it's official website (https://nodejs.org/en/)
I download the 8.9.3 version.
after installing node.js
2.open the command line and go to the project path.
3.then I input the command npm update.
it works,and the node_modules folder is created.But there are some warn message
4.finally input the command node app.js... it's not work with many error message
following is wrong message
I wonder know how should I do.Is any thing I didn't installed?
Please help me.I really want to research this mahjong project.
Before running npm update in the directory where you have your project, you should run npm install first to install all the required dependencies needed for the project to run.
So I advice to delete the node_modules directory that was created after you ran npm update, after which you can then run npm install. This should solve your issue.
Update: If you just want to try it online and not run it locally they've hosted a version on the web: http://gleitzman.com/apps/mahjong.
It's not your fault.
What you did was correct, but the project documentation needs to be updated. It's not a turn-key solution and you'll need to figure a few things out to get it working.
The error message is says it wants a mongo db instance, but you don't have one running. Try the mongodb home page or google for instructions. If you have docker it is pretty easy: docker run -it -p 27017:27017 mongo.
Even after spinning up mongodb I wasn't able to get the app to work locally. You could try contacting the repo maintainer for assistance. They may be happy to help given you've shown interest in their project.
Good Luck!

Is it possible to run React project without npm start?

I'm in a big trouble. Working in a part time in a company they're looking for a new web technology to build "web-component" in their website.
They have started to use AngularJS (first version) and I told them that, with the recent evolution of this framework, it's not the right period of time to deal with it.
That's why I began to be interested in ReactJS. However, they don't have a node.js server infrastructure (and that's why AngularJS suits to them, only one browser is sufficient) so it's impossible to run it with something like "npm start".
SO ! My question is (as my post's title says...) :
Is it possible to run ReactJS without server side ?
I've tried with the following line in my header
<script src="https://unpkg.com/react#15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom#15/dist/react-dom.js"></script>
But it remains a blank page.
Maybe there is something I don't understant in the react structure and that's why I'm looking for some help/explanations from you.
I hope I have been clear enough ! Thank you in advance for answer.
It is absolutely possible to run a React app without a production node server. Facebook provides an easy-to-use project bootstrapper that you can read about here
That being said, developers may need to use a node dev server locally via npm start, as well as using node to perform production builds via npm run build. But one can take the build output from npm run build and serve it from any static server and have a working react application.
For those who are getting 404's after deploying in a sub directory. Make sure to add the path in package.json as homepage.
"homepage": "https://example.com/SUB-DIRECTORY",
You should insert "homepage": "./" into your package.json file, then use building react-script command like npm run build.
I did it by using serve, as part of the build step in Jenkins. To install it, execute the command:
npm install -g serve
Then, to serve it:
serve -s build
Please, refer to project page for more information: https://github.com/zeit/serve

Installing KeystoneJS Error

Getting this error when trying to install KeystoneJS on DigitalOcean MEAN stack.
Getting this error: http://paste.ee/p/q1RmU
Using this command: sudo yo keystone (installed Yeoman)
Following this guide: http://keystonejs.com/getting-started/
I think that your running into a permissions issue with Yeoman. It is best practice to not use sudo for things like this.
I would suggest creating a user for keystone, logging in as that user, and following these instructions for 'globally' installing a npm module for a user. Essentially, you will setup a npm_packages directory for the user and add it to your path.
Once you've done that you can install yeoman as this user, and without sudo. This should allow you to install keystone okay. I know it seems like a lot of work, but this is the best way to securely set up a node app on a linux box.
I agree to KraigH. But An alternet way to get rid of this issue is changemod for whatever it complains.
I listed all possible dirs here.
chmod -R g+rwx /root /root/.config /root/.config/configstore /root/.npm
I tried to do what other says. that is to not use sudo. but it don't help.
I normally build a Docker image and deploy it behind a nginx reverse proxy

Categories

Resources