Showing posts from February, 2016

upgrade nodejs mac and npm update error module js

I had a problem updating npm after installing new version of node and this solved my problem curl | sh Note: If you get "301 Moved Permanently" then try curl -0 -L | sudo sh to follow redirects. Also notice I added sudo before the sudo sh command depending on your users permissions.

If you want to update stable version of nodejs. n is another nodejs version manager. or you can just go to, download and install it.

##Install module n

$ npm install -g n
$ n stable We are going to need sudo to do this.

Resources :

npm refusing to install as a dependency of itself

Cause :  The name of the module you are trying to install cannot be same as the name you defined in package.json
Let's say, you are trying to install hapi module in hapi directory, rename the name to something other than hapi
{ "name": "hapi-test",   "version": "1.0.0",   "description": "this is a test",   "main": "server.js",   "scripts": {     "test": "echo \"Error: no test specified\" && exit 1",     "start": "node server.js"   },   "keywords": [     "test"   ],   "author": "wai",   "license": "ISC",   "dependencies": {     "hapi": "^13.0.0"   } }
Here's more on package.json at

git basic commands : working with existing project : 1

Following commands are to add remote repos to your project folder. I use bitbucket for this example.
cd /path/to/my/yourprojectgit remote add origin push -u origin --all # pushes up the repo and its refs for the first time
And push all the folders and files under your current project folder
Add all folders and files

git add ./*
And commit
git commit -m "Your Project"
git push origin master
I will add more to this post.

Set up Visual Studio Code on Mac OSX

Step I : Setting up environment 

Download and Install Visual Studio Code from follow link and follow the instruction

Install ASP.NET 5 and DNX

Then append these lines to your ~/.bash_profile in your terminal

Run vim ~/.bash_profile

function code() { VSCODE_CWD="$PWD" open -n -b "" --args $*; }
export MONO_MANAGED_WATCHER=disabled

Run :x to save and exit vim.

Run source ~/.bash_profile or restart your terminal then run the following command.

Run dnvm upgrade

Part II : Getting Started

As shown above run following command in your terminal
npm install -g yo generator-aspnet gulp bower

Run yo aspnet
After that you will see like this. There you can choose as shown below.
After that you will see something like (for me I chose ConsoleApplication)

?========================================================================== We're constantly looking for ways to make yo better!  May we anonymo…

Open terminal to selected folder in OSX Finder

Go to System Preferences >> Keyboard >> Keyboard Shortcuts >> Services >> Files and Folders >> New Terminal at Folder or New Terminal Tab at Folder