Skip to content

Commit

Permalink
fix(install): read package.json in the method
Browse files Browse the repository at this point in the history
`require(package.json)` should be triggered when it's needed. If
it's put out of the function, it's called regardless of whether
it is necessary or not.

Fixes: https://github.com/watilde/dep/issues/5
  • Loading branch information
watilde committed Aug 27, 2017
1 parent cdb0542 commit a94dbe8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/install/saver.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const fs = require('fs')
const path = require('path')
const npmrc = require('../utils/npmrc')
const pkgJSON = require(path.join(process.cwd(), 'package.json'))

module.exports = (pkgs, save) => {
const pkgJSON = require(path.join(process.cwd(), 'package.json'))
var saveDeps = {}
pkgs.forEach((pkg) => {
const key = pkg.split('@')[0]
Expand Down

0 comments on commit a94dbe8

Please sign in to comment.