1) install Node.js first. and git for windows
Download the Windows installer from the Nodes.js® web site.
2) install bower, open node.js command prompt
C:\Users\hu_j>npm install -g bower
3) Now you can go to your project web folder to use bower install special package
for example:
C:\Users\hu_j>cd C:\jh\IIS\CivilGis\CivilGis
C:\jh\IIS\CivilGis\CivilGis>bower install angular-smart-table
NOTE:
a)
control panel > system> advance setting
add user path
;C:\Program Files\nodejs\
otherwise will get error "$npm' is not recognized as an internal or external command"----------------------------------------------------
b) must install git for windows, because bower need some package for git to get it.
Windows users
To use Bower on Windows, you must install msysgit correctly. Be sure to check the option shown below:
Note that if you use TortoiseGit and if Bower keeps asking for your SSH password, you should add the following environment variable:
GIT_SSH - C:\Program Files\TortoiseGit\bin\TortoisePlink.exe
. Adjust the TortoisePlink
path if needed.Installation Steps
- Download the Windows installer from the Nodes.js® web site.
- Run the installer (the .msi file you downloaded in the previous step.)
- Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
- Restart your computer. You won’t be able to run Node.js® until you restart your computer.
Test it!
Make sure you have Node and NPM installed by running simple commands to see what version of each is installed and to run a simple test program:
- Test Node. To see if Node is installed, open the Windows Command Prompt, Powershell or a similar command line tool, and type
node -v
. This should print a version number, so you’ll see something like this v0.10.35
.
- Test NPM. To see if NPM is installed, type
npm -v
in Terminal. This should print NPM’s version number so you’ll see something like this 1.4.28
- Create a test file and run it. A simple way to test that node.js works is to create a JavaScript file: name it
hello.js
, and just add the code console.log('Node is installed!');
. To run the code simply open your command line program, navigate to the folder where you save the file and type node hello.js
. This will start Node and run the code in the hello.js
file. You should see the output Node is installed!
.
node -v
. This should print a version number, so you’ll see something like this v0.10.35
.npm -v
in Terminal. This should print NPM’s version number so you’ll see something like this 1.4.28
hello.js
, and just add the code console.log('Node is installed!');
. To run the code simply open your command line program, navigate to the folder where you save the file and type node hello.js
. This will start Node and run the code in the hello.js
file. You should see the output Node is installed!
.
No comments:
Post a Comment