What is wrong with the Javascript-browsersync operation mode?

Source: Internet
Author: User
Tags install node

http://www.browsersync.cn/
Time-saving browser synchronization test tool

    1. 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.

    1. 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

    1. 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.

    1. 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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.