Search This Blog


Check out these Pages


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
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": [
  "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 anonymously report usage statistics to improve the tool over time? 
More info: &
========================================================================== Yes

    |       |    .--------------------------.
    |--(o)--|    |      Welcome to the      |
   `---------´   |   marvellous ASP.NET 5   |
    ( _´U`_ )    |        generator!        |
    /___A___\    '--------------------------'
     |  ~  |     
 ´   `  |° ´ Y

? What type of application do you want to create? Console Application
? What's the name of your ASP.NET application? MacNET_Test
   create MacNET_Test/.gitignore
   create MacNET_Test/Program.cs
   create MacNET_Test/project.json

Your project is now created, you can use the following commands to get going
    cd "MacNET_Test"
    dnu restore
    dnu build (optional, build will also happen when it's run)

    dnx run

Then you can follow as mentioned : 

cd "MacNET_Test" //Your project folder.
dnu restore
dnx run or web //based on the application type you chose above. Build will happen when command run)

Run " code . " in your terminal to launch Visual Studio Code.

Please drop me an email or comment. Thank you!!