Posts

Showing posts from February, 2016

upgrade nodejs mac and npm update error module js

Image
I had a problem updating npm after installing new version of node and this solved my problem curl https://npmjs.org/install.sh | sh Note: If you get "301 Moved Permanently" then try curl -0 -L http://npmjs.org/install.sh | 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 nodejs.org, download and install it.

##Install module n

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

Resources :
https://github.com/tj/n/issues/101
http://mazharahmed.me/upgrade-node-js-version-in-mac/
https://github.com/tj/n

npm refusing to install as a dependency of itself

Image
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 https://docs.npmjs.com/files/package.json



git basic commands : working with existing project : 1

Image
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 https://yourepo@bitbucket.org/yourrepo/myproject.gitgit 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"
then
git push origin master
I will add more to this post.


Set up Visual Studio Code on Mac OSX

Image
Step I : Setting up environment 

Download and Install Visual Studio Code from follow link and follow the instruction https://code.visualstudio.com/docs/editor/setup





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 "com.microsoft.VSCode" --args $*; }
source dnvm.sh
export MONO_MANAGED_WATCHER=disabled
then

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

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