Was checking existence of wrong package.json (#6222)

v1.18.x
Peter Jaszkowiak 7 years ago committed by Barış Soner Uşaklı
parent f70ddce5f9
commit 4c7a275034

@ -6,11 +6,9 @@ var path = require('path');
var packageInstall = require('./package-install');
var dirname = require('./paths').baseDir;
var defaultPackage;
// check to make sure dependencies are installed
try {
defaultPackage = JSON.parse(fs.readFileSync(path.join(dirname, 'install/package.json'), 'utf8'));
require('../../package.json');
} catch (e) {
if (e.code === 'ENOENT') {
console.warn('package.json not found.');
@ -32,6 +30,7 @@ try {
try {
var semver = require('semver');
var defaultPackage = require('../../install/package.json');
var checkVersion = function (packageName) {
var version = JSON.parse(fs.readFileSync(path.join(dirname, 'node_modules', packageName, 'package.json'), 'utf8')).version;

Loading…
Cancel
Save