Sabtu, 19 Oktober 2013

Xathrya Sabertooth

Xathrya Sabertooth


Introduction to NPM (Node Package Manager)

Posted: 19 Oct 2013 03:00 AM PDT

NPM (Node Package Manager) or simply npm is a simple application to install node programs. NPM also support a feature which will indicate dependencies and package starting file.

In this article, we will discuss about how to use npm, from a basic command to a rather advance one.

Getting Help

npm has a lot of feature, therefore let’s start by knowing how to get a help. NPM has a lot of help documentation about all of its command. Getting a help is as simple as typing this command on your terminal:

npm help

If you have a problem with any of npm command/feature, you can append –help on the command, leading to a documentation specific to that command. For example, both are valid command:

npm help install  npm install --help

Filtering Packages

npm ls [filter]

NPM can see the list of all packages and their version (npm ls with no filter), or filter by a tag (npm filter tag). For examples:

Installed Package

npm ls installed

This will list all installed package.

Stable Package

npm ls stable

This will list all stable package available (installed or not).

Search by Content

npm ls name

This way, we can have all packages that have “name” inside its name or tags.

Search by Version

npm ls @1.0

This is used to query packages specified by its version.

Install a Package

NPM is used to install,update, and remove a package. That’s what a package managers do.

When we want to install something, we can use following command and let NPM install the latest version of it to our machine. Here we will have “pkg_name” installed on our system.

npm install pkg_name

You can also install from a tarball, a folder, or an url to a tarball. If you run npm install without arguments, it tries to install the current folder. For example, we will install express:

npm install express

Or we can also install a specific version of a package by:

npm install express@2.0beta

We can also install the latest of a package within a version range we specify. For instance:

npm install express@">=0.1.0"

More filters can be used to select a specific packages.

Update Packages

npm update [pkg_name]

The update command does a few things:

  1. Search the registry for new versions of all the packages installed (if pkg_name is omitted) or specific packages.
  2. If there’s a newer version, then install it
  3. Point dependent packages at the new version, if it satisfies their dependency
  4. Remove old versions, if no other package names them as a dependency.

Basically, update behaves a lot like a “standard” package manager’s update command, except that it also checks to make sure that the new version isn’t going to break anything before it points stuff at it.

Remove Packages

This command will uninstall a package. If the version are omitted, then all the found version are removed.

npm rm pkg_name[@version] [pkg_name2[@version]]

Read Package Information

To view all of a package information, we can do like this:

npm view pkg_name[@version]

Installing .NET Framework 3.5 on Windows 8

Posted: 19 Oct 2013 12:57 AM PDT

On default, Windows 8 has shipped .NET Framework 4.5, installed and available. However, some app requires a specific version of .NET version. If the .NET version is lower than the provided (for example 3.5, like we want to discuss here) the app will fail to run. You will also be prompted to install .NET framework.

To run apps that require the .NET Framework 3.5 on Windows 8 or later, we must enable it. There are three ways to do it, two online method, and one offline method. The first two methods involves internet connection therefore you should present the Internet Access. The last method will do offline installation, what you need is Windows 8 installation CD.

Note that this instruction also apply to installing the .NET Framework 3.5 on Windows 8.1.

A special caution, any versions of .NET Framework should not be uninstalled from computer because there might be one or many app depends on a specific version and may break if that version is removed.

Multiple versions of the .NET Framework can be loaded on a single computer at the same time. This means, you do not have to uninstall previous version in order to install the later version.

On Demand Installation

In most case, if an app requires .NET Framework 3.5 and doesn’t find the version enabled on computer, it display a message box. The box will appear either during installation or when running the app for the first time. To enable the .NET framework 3.5, choose “Install this feature”. This option require internet connection.

IC556828

Enabling .NET Framework 3.5 in Control Panel

The .NET Framework 3.5 can also be installed through Control Panel. Choose “Programs and Features”, then “Turn Windows features on or off”, and then select the “.NET Framework 3.5 (includes .NET 2.0 and 3.0)” checkbox.

IC644075

You don’t need to select the “Windows Communication Foundation HTTP Activation” nor “Windows Communication Foundation Non-HTTP Activation” unless you are a developer who requires WCF script and handler mapping functionality.

Install by DVD

You need your Windows 8 installation DVD. If you are using ISO image, mount it. Make sure you remember the path / drive letter your disk (or image) is. In this article we will use G:\ as the example.

Open an Command prompt as administrator. You can do this by press start, type cmd which will give you some options. Navigate to Command Prompt and right click it. A new bar will appear, let’s click on “Run as administrator”.

start

Then we have a command prompt with escalated privilege.

Next, invoke following command. Assuming the DVD drive (where the DVD is) is G:\.

DISM.exe /Online /enable-feature /featurename:NetFX3 /Source:G:\sources\sxs /LimitAccess

After the installation finish, you will have the Microsoft .NET Framework 3.5 installed.

Tidak ada komentar:

Posting Komentar