Skip to content
Snippets Groups Projects
Commit 1da89f42 authored by Bob Mottram's avatar Bob Mottram
Browse files

Ensure global node modules directory is created during upgrades

parent 68f94f49
No related branches found
No related tags found
No related merge requests found
......@@ -181,6 +181,7 @@ function nodejs_upgrade {
if [ ! -f /etc/apt/sources.list.d/nodesource.list ]; then
return
fi
nodejs_setup_global_modules
if grep -q "node_8.x" /etc/apt/sources.list.d/nodesource.list; then
if [ -f /usr/local/bin/node ]; then
CURR_NODE_VERSION=$(node --version)
......@@ -204,6 +205,9 @@ function nodejs_upgrade {
}
function nodejs_setup_global_modules {
if [ ! -f /usr/local/bin/node ]; then
return
fi
if [ ! -d "$rootdir/root/.npm-global" ]; then
mkdir "$rootdir/root/.npm-global"
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment