From 0551967a35b03adbf4f353620cefd48e87f6c28e Mon Sep 17 00:00:00 2001 From: James Nylen Date: Wed, 9 Aug 2017 23:16:40 -0500 Subject: [PATCH 1/2] Fix errors and slowness during grunt-sass install process --- config/nvm | 1 + provision/provision.sh | 34 ++++++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) create mode 160000 config/nvm diff --git a/config/nvm b/config/nvm new file mode 160000 index 000000000..0a95e7700 --- /dev/null +++ b/config/nvm @@ -0,0 +1 @@ +Subproject commit 0a95e77000515c1156be593642dd4e452f2f098e diff --git a/provision/provision.sh b/provision/provision.sh index 8ff300c2b..42dcc0206 100755 --- a/provision/provision.sh +++ b/provision/provision.sh @@ -355,19 +355,37 @@ tools_install() { # # Install or Update Grunt based on current state. Updates are direct # from NPM + function hack_avoid_gyp_errors() { + # Without this, we get a bunch of errors when installing `grunt-sass`: + # > node scripts/install.js + # Unable to save binary /usr/lib/node_modules/.../node-sass/.../linux-x64-48 : + # { Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/... } + # Then, node-gyp generates tons of errors like: + # WARN EACCES user "root" does not have permission to access the dev dir + # "/usr/lib/node_modules/grunt-sass/node_modules/node-sass/.node-gyp/6.11.2" + # TODO: Why do child processes of `npm` run as `nobody`? + while [ ! -f /tmp/stop_gyp_hack ]; do + if [ -d /usr/lib/node_modules/grunt-sass/ ]; then + chown -R nobody:vagrant /usr/lib/node_modules/grunt-sass/ + fi + sleep .2 + done + rm /tmp/stop_gyp_hack + } if [[ "$(grunt --version)" ]]; then echo "Updating Grunt CLI" - npm update -g grunt-cli &>/dev/null - npm update -g grunt-sass &>/dev/null - npm update -g grunt-cssjanus &>/dev/null - npm update -g grunt-rtlcss &>/dev/null + npm update -g grunt-cli + hack_avoid_gyp_errors & npm update -g grunt-sass; touch /tmp/stop_gyp_hack + npm update -g grunt-cssjanus + npm update -g grunt-rtlcss else echo "Installing Grunt CLI" - npm install -g grunt-cli &>/dev/null - npm install -g grunt-sass &>/dev/null - npm install -g grunt-cssjanus &>/dev/null - npm install -g grunt-rtlcss &>/dev/null + npm install -g grunt-cli + hack_avoid_gyp_errors & npm install -g grunt-sass; touch /tmp/stop_gyp_hack + npm install -g grunt-cssjanus + npm install -g grunt-rtlcss fi + chown -R vagrant:vagrant /usr/lib/node_modules/ # Graphviz # From cd9aca4ffb35bac3cbcd4629f5f057ff5d367304 Mon Sep 17 00:00:00 2001 From: James Nylen Date: Thu, 10 Aug 2017 13:39:21 -0500 Subject: [PATCH 2/2] Remove errant submodule --- config/nvm | 1 - 1 file changed, 1 deletion(-) delete mode 160000 config/nvm diff --git a/config/nvm b/config/nvm deleted file mode 160000 index 0a95e7700..000000000 --- a/config/nvm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0a95e77000515c1156be593642dd4e452f2f098e