ibm-cloud-developer-tools: Node starter failing to build on Windows 10

Summary Node Basic Web App starter fails with the following error on Windows as there’s no folder called node_modules_linux (defined in cli_config.yml)

C:\lab\myapp>ibmcloud dev build
Getting service credentials for the application.
No service credentials were detected for the application to download.
Validating Docker image name
OK
Checking if Docker container myapp-express-tools is running
OK
Checking Docker image history to see if image already exists
OK
Creating image myapp-express-tools based on Dockerfile-tools ...

Executing docker image build --file Dockerfile-tools --tag myapp-express-tools --rm --pull --build-arg bx_dev_userid=0 --build-arg bx_dev_user=root .

Waiting for Docker image to build...
OK
Creating a container named 'myapp-express-tools' from that image...
FAILED
An error Error response from daemon: Mount denied:
The source path "C:/lab/myapp/node_modules_linux"
doesn't exist and is not known to Docker was encountered while creating Docker container 'myapp-express-tools'.

Steps to reproduce (include tooling version, platform, etc)

  1. ibmcloud dev create
  2. Choose node > node (web app)
  3. ibmcloud dev build

Operating System Windows 10

Supporting details

C:\lab\myapp>ibmcloud dev build
Getting service credentials for the application.
No service credentials were detected for the application to download.
Validating Docker image name
OK
Checking if Docker container myapp-express-tools is running
OK
Checking Docker image history to see if image already exists
OK
Creating image myapp-express-tools based on Dockerfile-tools ...

Executing docker image build --file Dockerfile-tools --tag myapp-express-tools --rm --pull --build-arg bx_dev_userid=0 --build-arg bx_dev_user=root .

Waiting for Docker image to build...
OK
Creating a container named 'myapp-express-tools' from that image...
FAILED
An error Error response from daemon: Mount denied:
The source path "C:/lab/myapp/node_modules"
doesn't exist and is not known to Docker was encountered while creating Docker container 'myapp-express-tools'.

Development “done” checklist

  • Test case to verify
  • Public Documentation updated
  • Change added to “release notes” as appropropriate
  • Notification to stakeholders (OM, other squads, etc)

About this issue

Most upvoted comments

1 - In your local cli-config.yml, replace these lines:

# The name for the dockerfile for the run container
dockerfile-run : "Dockerfile"
# The name for the dockerfile for the tools container
dockerfile-tools : "Dockerfile-tools"

with https://github.com/joyychang/node-windows-workaround/blob/master/cli-config.yml#L21-L24

2 - copy docker-compose-tools.yml and docker-compose.yml to your local directory

3 - edit docker-compose-tools.yml Change:

image: "nodejsmicroservicewithexpressjstutorial-express-tools"
container_name: "nodejsmicroservicewithexpressjstutorial-express-tools"

save your changes.

ibmcloud dev build results in:

Step 18/18 : RUN if [ "$bx_dev_user" != root ]; then useradd -ms /bin/bash -u $bx_dev_userid $bx_dev_user; fi
 ---> Running in 0bc615f3757a
Removing intermediate container 0bc615f3757a
 ---> 171357ea214f
Successfully built 171357ea214f
Successfully tagged nodejsmicroservicewithexpressjstutorial-express-tools:latest
Recreating windowsnodeondeck-express-tools ... done
Starting the 'nodejsmicroservicewithexpressjstutorial-express-tools'
container...
OK
The 'nodejsmicroservicewithexpressjstutorial-express-tools' container is
already running
Executing npm install command started at Wed Nov 13 08:29:57 2019...
OK
time="2019-11-13T08:30:19+01:00" level=info msg="[0/1] [web]: Stopping "
time="2019-11-13T08:30:19+01:00" level=info msg="[0/1] [web]: Stopped "

so we now have a workaround. Still, any Win 10 user following this tutorial will face the dev build issue.

And will possibly will have a hard time before discovering the above workaround. Resulting in bad user experience.

@steveclay - this issue is nearly 1 year old - no assignee and a hard to find workaround Any way to give this one a high priority?

@steveclay I think this is a duplicate. Can you confirm that you have an issue open?