http://www.browsersync.cn/
Time-saving browser synchronization test tool
Install node. js
Browsersync is based on node. JS and is a node module, and if you want to use it quickly, you might need to install node. JS First
The installation is for Mac Os,windows and Linux.
Installing Browsersync
You can choose to install Browsersync from node. JS's package management (NPM) library. Open a terminal window and run the following command:
NPM install-g Browser-sync
You tell the package Manager to download the Browsersync files and install them globally, and you can use them in all projects (any directory).
Of course you can also use the Gulpjs or Gruntjs build tool to run the following command in the project you need to build:
Problems encountered
NPM has a version installed that is 2.7.4
Git also installs version 2.5.1.windows.1 don't know if it has anything to do with this?
NPM install-g Browser-sync is already installed. In the Node_modules directory!
What is this situation, the first time the novice encountered the problem I really can not solve.
Reply content:
http://www.browsersync.cn/
Time-saving browser synchronization test tool
Install node. js
Browsersync is based on node. JS and is a node module, and if you want to use it quickly, you might need to install node. JS First
The installation is for Mac Os,windows and Linux.
Installing Browsersync
You can choose to install Browsersync from node. JS's package management (NPM) library. Open a terminal window and run the following command:
NPM install-g Browser-sync
You tell the package Manager to download the Browsersync files and install them globally, and you can use them in all projects (any directory).
Of course you can also use the Gulpjs or Gruntjs build tool to run the following command in the project you need to build:
Problems encountered
NPM has a version installed that is 2.7.4
Git also installs version 2.5.1.windows.1 don't know if it has anything to do with this?
NPM install-g Browser-sync is already installed. In the Node_modules directory!
What is this situation, the first time the novice encountered the problem I really can not solve.
Probably because you didn't configure the path of node. js to the PATH environment variable
Input browser-sync
He will use the require () system provided by node to find the locally installed Browser-sync module.
You enter in command line mode
browser-sync
Similar to the following example
node> var browserSync = require('browser-sync');> browserSync()
Workaround: Right-click My Computer-tap Properties-click System Properties-Select advanced Options-click Environment Variables-find path-in System variables edit variable value to copy the node path to the last face.