简体   繁体   中英

Easy way to manage package.json

I'm looking for a sane way to switch between using npm link and git or some other solution that works well for both front end and back end developers.

The problem is that I am writing a website which uses several packages I have written myself. I want to share these with other people in my team. Originally I had everyone in my team clone each package and then use npm link. This however becomes complex for others when they aren't sure which dependencies are updated or forget to pull some.

Recently I discovered that I can put my git repository links in the package.json file which is great for everyone working on the front end. They can pull and not worry about which dependencies need updating. Anyone working on the back end however, now needs to update dependencies after every change.

You can do some of what you need automatically but it will not be free if your repositories are not public (which is not free now as well in that case).

You can have teams and private packages on npm. See:

Private packages are $7/month.

You can use Greenkeeper to check your modules and post pull requests with updates to your developers who want to update their package.json. What Greenkeeper does is updating the actual package.json files, running tests to see if the update doesn't break anything and posting pull requests that you can review and merge with info about the test results.

See: https://greenkeeper.io/

Greenkeeper is literally a robot that manages the package.json for you in the scope that you describe, ie updating versions of dependencies whenever new ones are released.

@rsp has some great options in his answer. Another is to host your own npm: https://www.npmjs.com/package/sinopia

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