From 4c7a275034fae8bb1bb634d0bbcf6c6e1fbc6ad5 Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Wed, 10 Jan 2018 09:50:34 -0700
Subject: [PATCH] Was checking existence of wrong package.json (#6222)
---
src/cli/index.js | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/cli/index.js b/src/cli/index.js
index 8d1302ffea..f5b2075166 100644
--- a/src/cli/index.js
+++ b/src/cli/index.js
@@ -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;