Ensure global node modules directory is created during upgrades
This commit is contained in:
parent
68f94f498e
commit
1da89f4273
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue