aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkihiro Nagai <77012577+akihironagai@users.noreply.github.com>2023-02-27 20:12:21 +0300
committerGitHub <noreply@github.com>2023-02-27 20:12:21 +0300
commit83c6103db23ce383a23097832bdf15d71f775665 (patch)
tree2020b0ef06462373beaaee3e2cd37b2e65250aad /src
parentd84e46be47867e596fdd2f2efaefb63f67597a07 (diff)
Add pnpm in Node (#450)feature_node_1.2.0
* Add pnpm in Node * pnpm from npm * Restore README.md * Update install.sh * Update tests
Diffstat (limited to 'src')
-rw-r--r--src/node/devcontainer-feature.json6
-rwxr-xr-xsrc/node/install.sh11
2 files changed, 14 insertions, 3 deletions
diff --git a/src/node/devcontainer-feature.json b/src/node/devcontainer-feature.json
index 6450ce4..9bf90b6 100644
--- a/src/node/devcontainer-feature.json
+++ b/src/node/devcontainer-feature.json
@@ -1,9 +1,9 @@
{
"id": "node",
- "version": "1.1.5",
- "name": "Node.js (via nvm) and yarn",
+ "version": "1.2.0",
+ "name": "Node.js (via nvm), yarn and pnpm",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/node",
- "description": "Installs Node.js, nvm, yarn, and needed dependencies.",
+ "description": "Installs Node.js, nvm, yarn, pnpm, and needed dependencies.",
"options": {
"version": {
"type": "string",
diff --git a/src/node/install.sh b/src/node/install.sh
index 4c02c95..9048ac2 100755
--- a/src/node/install.sh
+++ b/src/node/install.sh
@@ -183,6 +183,17 @@ if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then
IFS=$OLDIFS
fi
+# Install pnpm
+if type pnpm > /dev/null 2>&1; then
+ echo "pnpm already installed."
+else
+ if type npm > /dev/null 2>&1; then
+ npm install -g pnpm
+ else
+ echo "Skip installing pnpm because npm is missing"
+ fi
+fi
+
# If enabled, verify "python3", "make", "gcc", "g++" commands are available so node-gyp works - https://github.com/nodejs/node-gyp
if [ "${INSTALL_TOOLS_FOR_NODE_GYP}" = "true" ]; then
echo "Verifying node-gyp OS requirements..."