Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghcr.io/devcontainers/features/node doesn't work on macos #1240

Open
yu2003w opened this issue Jan 14, 2025 · 5 comments
Open

ghcr.io/devcontainers/features/node doesn't work on macos #1240

yu2003w opened this issue Jan 14, 2025 · 5 comments
Assignees

Comments

@yu2003w
Copy link

yu2003w commented Jan 14, 2025

Hi, it seems that features/node doesn't work on mac os.
Is there any plan to support this?

`bash-3.2$ docker pull ghcr.io/devcontainers/features/node:1

1: Pulling from devcontainers/features/node
unsupported media type application/vnd.devcontainers
bash-3.2$ uname -a
Darwin macbook.local 24.2.0 Darwin Kernel Version 24.2.0: Fri Dec 6 19:00:33 PST 2024; root:xnu11215.61.5~2/RELEASE_ARM64_T8122 arm64`

@yu2003w yu2003w changed the title ghcr.io/devcontainers/features/node doesn't work on macbook ghcr.io/devcontainers/features/node doesn't work on macos Jan 14, 2025
@bamurtaugh
Copy link
Member

Thanks for opening. @Kaniska244 if you get a moment, could you please take a closer look?

@Kaniska244
Copy link
Contributor

Hi @yu2003w ,

This "ghcr.io/devcontainers/features/node:1" isn’t a regular image. Its a feature added on top of other devcontainer images. You could check https://github.com/devcontainers/images/blob/main/src/javascript-node/README.md#using-this-image , which contain reference of full fledged, regular devcontainer images for node from MCR repo for different linux flavors such as the followings.

mcr.microsoft.com/devcontainers/javascript-node (latest)
mcr.microsoft.com/devcontainers/javascript-node:22 (or 22-bookworm, 22-bullseye to pin to an OS version)
mcr.microsoft.com/devcontainers/javascript-node:20 (or 20-bookworm, 20-bullseye to pin to an OS version)
mcr.microsoft.com/devcontainers/javascript-node:18 (or 18-bookworm, 18-bullseye to pin to an OS version)

Kindly let me know in case of any further concern on this.

With Regards,
Kaniska

@yu2003w
Copy link
Author

yu2003w commented Feb 6, 2025

Hi @Kaniska244,
Thanks very much for your reply.
When I tried to setup dev environment of langflow (https://github.com/langflow-ai/langflow) on my macbook, the log indicated that nvm is not installed as below.
I suspect that it's related with ghcr.io/devcontainers/features/node, however I failed to figure this out.
I will try the same stuff on ubuntu to check whether it's working or not. I suspected that something is not supported well on macOS.

5.636 Setting up apt-transport-https (2.6.1) ...

6.559 NVM_VERSION=0.40.1
7.247 zsh:12: command not found: nvm
7.247 ERROR: Feature "Node.js (v
[2025-02-06T16:47:12.084Z] ia nvm), yarn and pnpm" (ghcr.io/devcontainers/features/node) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/node for help troubleshooting this error.

[2025-02-06T16:47:12.087Z] ERROR: failed to solve: process "/bin/zsh -c cp -ar /tmp/build-features-src/node_0 /tmp/dev-container-features && chmod -R 0755 /tmp/dev-container-features/node_0 && cd /tmp/dev-container-features/node_0 && chmod +x ./devcontainer-features-install.sh && ./devcontainer-features-install.sh && rm -rf /tmp/dev-container-features/node_0" did not complete successfully: exit code: 127
[2025-02-06T16:47:12.087Z]
View build details: �]8;;docker-desktop://dashboard/build/desktop-linux/desktop-linux/tzgd9ov92d1giz8n7m8hisbp6�\docker-desktop://dashboard/build/desktop-linux/desktop-linux/tzgd9ov92d1giz8n7m8hisbp6�]8;;�
[2025-02-06T16:47:12.092Z] Stop (7645 ms): Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/devcontainercli/container-features/0.72.0-1738860412097/Dockerfile-with-features -t vsc-langflow-0acddd1c5cc938cc93945fbcb666c1cdf13571fdd695ebb61bab274c99b118c1 --target dev_containers_target_stage --build-context dev_containers_feature_content_source=/var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/devcontainercli/container-features/0.72.0-1738860412097 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=langflow --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /Users/jared/vault/langflow
[2025-02-06T16:47:12.093Z] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/devcontainercli/container-features/0.72.0-1738860412097/Dockerfile-with-features -t vsc-langflow-0acddd1c5cc938cc93945fbcb666c1cdf13571fdd695ebb61bab274c99b118c1 --target dev_containers_target_stage --build-context dev_containers_feature_content_source=/var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/devcontainercli/container-features/0.72.0-1738860412097 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=langflow --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /Users/jared/vault/langflow
[2025-02-06T16:47:12.093Z] at RtA (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.394.0/dist/spec-node/devContainersSpecCLI.js:466:1933)
[2025-02-06T16:47:12.094Z] at async _m (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.394.0/dist/spec-node/devContainersSpecCLI.js:465:1896)
[2025-02-06T16:47:12.094Z] at async bH (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.394.0/dist/spec-node/devContainersSpecCLI.js:465:610)
[2025-02-06T16:47:12.094Z] at async TtA (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.394.0/dist/spec-node/devContainersSpecCLI.js:482:3848)
[2025-02-06T16:47:12.094Z] at async iB (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.394.0/dist/spec-node/devContainersSpecCLI.js:482:4963)
[2025-02-06T16:47:12.094Z] at async wrA (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.394.0/dist/spec-node/devContainersSpecCLI.js:663:203)
[2025-02-06T16:47:12.094Z] at async DrA (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.394.0/dist/spec-node/devContainersSpecCLI.js:662:14830)
[2025-02-06T16:47:12.094Z] at async /Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.394.0/dist/spec-node/devContainersSpecCLI.js:482:1190
[2025-02-06T16:47:12.102Z] Stop (20353 ms): Run: /private/var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/AppTranslocation/C2925269-4086-4ED5-8647-542EB7A1E09B/d/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.394.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/jared/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-e0b8fb4d-ac3e-41d8-b03d-cd6b70beae2e1738860411161 --workspace-folder /Users/jared/vault/langflow --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/Users/jared/vault/langflow --id-label devcontainer.config_file=/Users/jared/vault/langflow/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/jared/vault/langflow/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration
[2025-02-06T16:47:12.103Z] Exit code 1
[2025-02-06T16:47:12.106Z] Command failed: /private/var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/AppTranslocation/C2925269-4086-4ED5-8647-542EB7A1E09B/d/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.394.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/jared/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-e0b8fb4d-ac3e-41d8-b03d-cd6b70beae2e1738860411161 --workspace-folder /Users/jared/vault/langflow --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/Users/jared/vault/langflow --id-label devcontainer.config_file=/Users/jared/vault/langflow/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/jared/vault/langflow/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration
[2025-02-06T16:47:12.106Z] Exit code 1

Regrads,
Jared

@Kaniska244
Copy link
Contributor

Hi @yu2003w ,

This is indeed failing while installing the node feature which is configured in the devcontainer.json in https://github.com/langflow-ai/langflow repo. The problem looks like that in MacBook you must be having default prompt as zsh & I can see as per the error stack trace, its being executed in zsh.
This node feature referred here, requires bash to work (Ref: https://github.com/devcontainers/features/tree/main/src/node#os-support).

Please let me know in case of any further concern on this.

With Regards,
Kaniska

@yu2003w
Copy link
Author

yu2003w commented Feb 12, 2025

Hi @Kaniska244 ,
I changed 'zsh' to 'bash' in both dev.container.json and Dockerfile as below.

jared@macbook langflow % git status                                          
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   .devcontainer/Dockerfile
        modified:   .devcontainer/devcontainer.json

no changes added to commit (use "git add" and/or "git commit -a")
jared@macbook langflow % git diff
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index cb71de06c..46482efff 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -23,13 +23,13 @@ RUN apt-get update && apt-get install -y \
 
 # Create the vscode user and group with the expected UID and GID (1000)
 RUN groupadd -g 1000 langflow && \
-    useradd -m -u 1000 -g 1000 -s /bin/zsh langflow && \
+    useradd -m -u 1000 -g 1000 -s /bin/bash langflow && \
     echo "langflow ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
 
 # Set default shell to Zsh
-SHELL ["/bin/zsh", "-c"]
+SHELL ["/bin/bash", "-c"]
 
-RUN echo 'export PS1="%~ %# "' >> /home/langflow/.zshrc
+RUN echo 'export PS1="%~ %# "' >> /home/langflow/.bashrc
 
 # Set the default user
 USER langflow
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 5ad55243d..5f8b1da3d 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -24,10 +24,10 @@
         "GitHub.vscode-pull-request-github"
       ],
       "settings": {
-        "terminal.integrated.defaultProfile.linux": "zsh",
+        "terminal.integrated.defaultProfile.linux": "bash",
         "terminal.integrated.profiles.linux": {
-          "zsh": {
-            "path": "/bin/zsh"
+          "bash": {
+            "path": "/bin/bash"
           }
         }
       }

I still got the error as below,

12.96 Setting up apt-transport-https (2.6.1) ...
[2025-02-12T16:24:10.902Z] 15.97 NVM_VERSION=0.40.1
16.59 bash: line 12: nvm: command not found
16.60 ERROR: Feature "Node.js (via nvm), yarn and pnpm" (ghcr.io/devcontainers/features/node) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/node for help troubleshooting this error.
------
[2025-02-12T16:24:10.904Z] ERROR: failed to solve: process "/bin/bash -c cp -ar /tmp/build-features-src/node_0 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/node_0  && cd /tmp/dev-container-features/node_0  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/node_0" did not complete successfully: exit code: 127
[2025-02-12T16:24:10.904Z] 
View build details: �]8;;docker-desktop://dashboard/build/desktop-linux/desktop-linux/md0n8u06gg8uj9scujna122sk�\docker-desktop://dashboard/build/desktop-linux/desktop-linux/md0n8u06gg8uj9scujna122sk�]8;;�\
[2025-02-12T16:24:10.910Z] Stop (16907 ms): Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/devcontainercli/container-features/0.73.0-1739377418851/Dockerfile-with-features -t vsc-langflow-0acddd1c5cc938cc93945fbcb666c1cdf13571fdd695ebb61bab274c99b118c1 --target dev_containers_target_stage --build-context dev_containers_feature_content_source=/var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/devcontainercli/container-features/0.73.0-1739377418851 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=langflow --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /Users/jared/vault/langflow
[2025-02-12T16:24:10.912Z] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/devcontainercli/container-features/0.73.0-1739377418851/Dockerfile-with-features -t vsc-langflow-0acddd1c5cc938cc93945fbcb666c1cdf13571fdd695ebb61bab274c99b118c1 --target dev_containers_target_stage --build-context dev_containers_feature_content_source=/var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/devcontainercli/container-features/0.73.0-1739377418851 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=langflow --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /Users/jared/vault/langflow
[2025-02-12T16:24:10.912Z]     at RtA (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:469:1933)
[2025-02-12T16:24:10.912Z]     at async jm (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:468:1896)
[2025-02-12T16:24:10.912Z]     at async bH (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:468:610)
[2025-02-12T16:24:10.912Z]     at async TtA (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:485:3848)
[2025-02-12T16:24:10.912Z]     at async iB (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:485:4963)
[2025-02-12T16:24:10.912Z]     at async wrA (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:666:203)
[2025-02-12T16:24:10.912Z]     at async DrA (/Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:665:14830)
[2025-02-12T16:24:10.912Z]     at async /Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js:485:1190
[2025-02-12T16:24:10.920Z] Stop (32293 ms): Run: /private/var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/AppTranslocation/8D880435-1D28-49EC-A514-32A6367B9D5A/d/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/jared/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-6bd683d5-1db0-4929-8563-5a16457db4131739377418076 --workspace-folder /Users/jared/vault/langflow --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/Users/jared/vault/langflow --id-label devcontainer.config_file=/Users/jared/vault/langflow/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/jared/vault/langflow/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration
[2025-02-12T16:24:10.920Z] Exit code 1
[2025-02-12T16:24:10.925Z] Command failed: /private/var/folders/vj/4s8h8csd6h35mfb7dg2_sy840000gn/T/AppTranslocation/8D880435-1D28-49EC-A514-32A6367B9D5A/d/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/jared/.vscode/extensions/ms-vscode-remote.remote-containers-0.397.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/jared/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-6bd683d5-1db0-4929-8563-5a16457db4131739377418076 --workspace-folder /Users/jared/vault/langflow --workspace-mount-consistency cached --gpu-availability detect --id-label devcontainer.local_folder=/Users/jared/vault/langflow --id-label devcontainer.config_file=/Users/jared/vault/langflow/.devcontainer/devcontainer.json --log-level debug --log-format json --config /Users/jared/vault/langflow/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root --include-configuration --include-merged-configuration
[2025-02-12T16:24:10.926Z] Exit code 1

Possibly I misunderstood something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants