Node JS

Solve – cors problem

app.use(function(req, res, next) { res.header(“Access-Control-Allow-Origin”, “*”); res.header(“Access-Control-Allow-Headers”, “Origin, X-Requested-With, Content-Type, Accept”); next(); }); app.get(‘/’, function(req, res, next) { // …. }); app.post(‘/’, function(req, res, next) { // …. });

0 comments

sh: 1: cross-env: Permission denied – Fixed

The following fixes it. npm rebuild

0 comments

Install node js – ubuntu

sudo apt-get –purge remove node sudo apt-get –purge remove nodejs sudo apt-get install nodejs sudo ln -s /usr/bin/nodejs /usr/bin/node

0 comments

npm – Refusing to install gulp as a dependency of itself

Yeah, if the name of the package in package.json is “gulp”, then it will throw error. The name of the package is created when we run: npm init “name”: “gulp”. In other words the name of directory in which you are running the command will give a default package name and you need to change […]

0 comments