How to setup a MEAN in Windows 7 - angularjs

I have done a node.js server install and checked the node --version in the command prompt
I have done this much but I couldn't stat the npm.

It seems you have installed nodeJs already on your computer. But I will explain step by step how to setup a project with MongoDb + express + Angular + NodeJs
Install MongoDB, Configure and Run - Download MongiDb installer and install MongoDB on your computer. Follow the screen instructions. Read installation guide for windows here
Install NodeJs - Download and install NodeJs. Open command prompt and type "node -v", if this command runs without an issue, that mean you have installed NodeJs on your computer
Setup a project - Create a empty folder. Open command prompt and go inside the folder. Now type npm init. Provide answers for questions prompt in command prompt. Once you complete that you can see package.json file is created in your folder.
Install express - To install express type npm install express --save
Install bower package manager - Run npm install -g bower if you don't installed bower before on your computer. (Bower is a package manager for font end websites.)
Install AngularJs - Run bower install angular --save command to install angular
Create a NodeJs Server - Create a file index.js. This will be an entry point of your nodeJs app
const express = require('express')
const app = express()
app.get('/', function (req, res) {
res.send('Hello World!')
})
app.listen(3000, function () {
console.log('Example app listening on port 3000!')
})
Run node index.js. Your website is now running on http://localhost:3000.
Please read some tutorial here to get more information

If you have every thing installed (Mongo,Node) then you can try yeoman application generator.It will create a sample application for you with all the required folders and you just need node modules and bower components to install.
Please read this here:-
http://yeoman.io/
You don't need to bother any thing for any of your folders

Related

How can I deploy my react project for production?

How can transform my react project into script to connect it to html page?
I am a new one in react please be tolerant. My boss demands to get completed script to connect it to html page without node and etc. What shall I do? Thank you.
Please check this url:
https://blog.bitsrc.io/react-production-deployment-part-3-heroku-316319744885
Also, Please check these steps:
In package.json, added this line to the scripts
"heroku-postbuild":
"NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run
build --prefix client".
Then added this
"engines": { "node" : "[your node version]" } after scripts.
In index.js, put the following code after your routes set up
if (process.env.NODE_ENV === "production") {
app.use(express.static("client/build"));
const path = require("path");
app.get("*", (req, res) => {
res.sendFile(path.resolve(__dirname, "client", "build",
"index.html"));
});
}
I assume that you use git for version control and already install Heroku.
Open your terminal, then Heroku login -> Heroku create -> git push Heroku
master. If you do not get any error, you are a success to deploy your app.
Hope you will get it to work.
In order to get rid of node, you need to first build your project. If you've initialized your project with create-react-app, run this command:
npm run build
A folder named 'build' will appear in your project root containing your production app. Now the build folder is ready to build and you can serve it with a static server like 'serve'. To install 'serve' via npm, do this:
npm install -g serve
that's it! you can serve it now:
serve -s build
You can find out more about deployment here:
https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#deployment
by using create-react-app
https://create-react-app.dev/docs/getting-started
https://create-react-app.dev/docs/deployment
dev: npm start or yarn start.
prod: npm run build or yarn build.

No `package.json` file found. Make sure you are running the command in a Node.js project

I am building a AngularJS file with typescript and installed tsd for typedefinitions globally. When I try to run the following command on the root of my project folder I am getting an error
I am new Angular JS using version 1.7. I am not sure if Package.json is needed for AngularJS project
Command
tsd install angular --resolve --save
Error
No package.json file found. Make sure you are running the command in a Node.js project.
package.json is required for node projects to specify metadata about project and include some important commands that may be required for the project build. First you have to install node from official website. You can google for the step by step installation. Once installed, goto your project directory and run this command. Make sure to perform "npm init" before you run the desired angular command.
Note: Ensure, node is accessible through cli
tsd is deprecated use #types node modules
npm i #types/angular --save

how can I run an exisiting project in react

I am new in react, and now I have an available project which is needed some kind of development. The whole project consists of app and build folder and both of them also have index.html file and some other staff. How can I launch this project for viewing its demo in linux?could anyone explain the process step by step?
thanks in advance
Approach 1: Via Node
Install Node Install Node on linux machine
Once successfully installed, go to project folder and run npm install to install dependencies.
Run command "npm start" or in background "nohup npm start &" will start default application on 3000 port, from browser check http://IP/domain name:3000
Approach 2 Via Yarn
Install Yarn on linux machine Install Yarn
from project folder run yarn install will install all dependencies.
run yarn build will create complied code in /build folder
Install apache or Ngnix and move build folder content to apache or ngnix web root folder
Access app from http://IP or domain name if seted up for ip.

Angular Template in MVC Core does not install the npm packages

I have created a new applicationWeb Core + Angular template in VS 2017. But in the npm nodes all angular files are marked as not installed. What should I do?
Here is screenshot
Open a command prompt in the solution directory and type the command:
npm install
Note: you must have node.js installed (NodeJs)

npm install connect issue

I am new to node.js. I have been undergoing Angular.js Pro by Adam Freeman
As per the installation step:
I need to setup the web server for angular.js application using nodejs.
Accordingly i installed node.js version 6.11.0 in the path:
C:\Program Files\nodejs
Next step is to install connect module of nodejs using the command npm install connect.
I am getting the below error message when doing so.
shell output here
Can please anybody help with this.
You don't have to do that in the node.js path.
You can head over to a new directory say ~/desktop/temp
And then first do npm init, which would set the project to use npm. It would ask a couple of questions.
Post this, do npm install connect
Well, you need to start clean in an empty folder of your choice. This will be your project folder.
cd into it, then run npm init
Now you're ready to npm install whatever packages you need.

Resources