"Nodejs" Installation Browser-sync encountered an error prompt

Source: Internet
Author: User

First I used a Mac computer when I performed the installation of Browser-sync, I encountered the following problems:

Because it is not allowed, I can only not install the global:

But there are new problems.

Tangled for half an hour, and finally knew why this problem had arisen,

Node only --global or -g is the global installation of the package, the general will appear in the path, you can directly run the command, otherwise ./node_modules/.bin/ , you need to add a path to run, you can also be added in the Package.json, the environment variable of this portal is included by default node_modules/.bin, you can directly

"scripts": {  "watch": "browser-sync start --server --files ‘css/*.css‘"}

然后npm run watch就ok了

"Nodejs" Installation Browser-sync encountered an error prompt

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.