简体   繁体   中英

How can I update the package.json using meteor add?

How can I get my package.json updated by meteor add command as it can be achieved by npm install --save ?

I just read there that meteor writes in the .meteor/package . Does that mean package.json can only be updated via npm install --save whereas meteor add only effects .meteor/package ?

I'll highly appreciate detailed information on that.

There are two ways of adding packages to a meteor project.

  1. With meteor add
  2. With npm install

These are two separate ways of managing packages, and one doesn't affect the other.

If you install, for example, jquery with meteor add , you'd use import {$} 'meteor/jquery' to use in a file.

If you use npm install to install jquery, then you might use import $ from 'jquery' .

Don't confuse npm packages with meteor packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM