Remove node_modules when upgrading Node

This commit is contained in:
Nate Coraor
2022-02-14 10:31:46 -05:00
parent 5eeff5dc7b
commit 85dcd60d4c
+4
View File
@@ -235,6 +235,10 @@ fi
if [ -n "$VIRTUAL_ENV" ]; then
if ! in_venv "$(command -v node)" || [ "$(node --version)" != "v${NODE_VERSION}" ]; then
echo "Installing node into $VIRTUAL_ENV with nodeenv."
if [ -d "${VIRTUAL_ENV}/lib/node_modules" ]; then
echo "Removing old ${VIRTUAL_ENV}/lib/node_modules directory."
rm -rf "${VIRTUAL_ENV}/lib/node_modules"
fi
nodeenv -n "$NODE_VERSION" -p
fi
elif [ -n "$CONDA_DEFAULT_ENV" ] && [ -n "$CONDA_EXE" ]; then