From 902f20cbdd17d8d960b49cf3c446c5516f05d065 Mon Sep 17 00:00:00 2001 From: Lucas Katayama Date: Fri, 21 Oct 2016 10:54:35 -0200 Subject: [PATCH 1/2] Fixing global add in linux root folder #1029 --- src/constants.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/constants.js b/src/constants.js index 07499ccf04..fc4bb9a248 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,7 +1,9 @@ /* @flow */ - -const userHome = require('user-home'); const path = require('path'); +let userHome = require('user-home'); +if (process.platform === 'linux' && process.env.USER === 'root') { + userHome = path.resolve(process.execPath, '..', '..', 'lib'); +} type Env = {[key: string]: ?string}; From 91267dcb2faa46147af9699c5d3c20bfb3b64ada Mon Sep 17 00:00:00 2001 From: Lucas Katayama Date: Mon, 31 Oct 2016 00:29:25 -0200 Subject: [PATCH 2/2] Changing global path to /usr/local/share --- src/constants.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/constants.js b/src/constants.js index fc4bb9a248..286289453a 100644 --- a/src/constants.js +++ b/src/constants.js @@ -2,10 +2,12 @@ const path = require('path'); let userHome = require('user-home'); if (process.platform === 'linux' && process.env.USER === 'root') { - userHome = path.resolve(process.execPath, '..', '..', 'lib'); + userHome = path.resolve('/usr/local/share'); } -type Env = {[key: string]: ?string}; +type Env = { + [key: string]: ? string +}; export const DEPENDENCY_TYPES = [ 'devDependencies',