Joe Bank
Joe Bank

Reputation: 663

Running Babel on NodeJS5.12.0 image inside the Docker for Windows

Well, I've been trying to run this over the past few days and whatever I do, it ends up in an error. Here's the scenario. I'm trying to run a dev environment base on Cory House's redux starter kit found here: https://github.com/coryhouse/pluralsight-redux-starter

To do this I did several things:

  1. Installing Docker for Windows.

  2. Selecting "D" as the Shared Drives in the Settings dialog and saving my "Windows 10" credentials so that Docker could access the "D" partition.

  3. Opening up an elevated "PowerShell".

  4. Pulling NodeJS:5.12.0 using the docker pull node:5.12.0 command.

  5. Creating a container using the following command: docker run -it -v d:/temp:/www node:5.12.0 bash

  6. Pulling the package.json, webpack.config.dev.js, .babelrc, and .eslintrc from https://github.com/coryhouse/pluralsight-redux-starter and copying them to the "d:\temp" folder on my Windows machine.

  7. Changing from the root directory to "www" inside the bash.

  8. Installing packages using npm install.

  9. Everything seems to be installed correctly, except that at the end, I received the following error message:

    67097 warn optional Skipping failed optional dependency /chokidar/fsevents:
    67098 warn notsup Not compatible with your operating system or architecture: [email protected]
    67099 verbose stack Error: ENOTSUP: operation not supported on socket, symlink
      '../acorn/bin/acorn' ->
      '/www/node_modules/acorn-jsx/node_modules/.bin/acorn'
    67099 verbose stack at Error (native)
    67100 verbose cwd /www
    67101 error Linux 4.4.15-moby
    67102 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
    67103 error node v5.12.0
    67104 error npm  v3.8.6
    67105 error path ../acorn/bin/acorn
    67106 error code ENOTSUP
    67107 error errno -95
    67108 error syscall symlink
    67109 error nospc ENOTSUP: operation not supported on socket, symlink
      '../acorn/bin/acorn' ->
      '/www/node_modules/acorn-jsx/node_modules/.bin/acorn'
    67110 error nospc This is most likely not a problem with npm itself
    67110 error nospc and is related to insufficient space on your system.
    67111 verbose exit [ -95, true ]
    
  10. Anyway, I ignored the message and I entered npm start and the following error occurs:

    npm info it worked if it ends with ok
    npm info using [email protected]
    npm info using [email protected]
    npm info lifecycle [email protected]~prestart: [email protected]
    > [email protected] prestart /www
    > babel-node tools/startMessage.js
    sh: 1: babel-node: not found
    

I tried npm list | grep babel to make sure that babel is installed, correctly and it looks like it's there. So what is wrong here? Please note that I'm new to Docker, Linux, NodeJS and NPM.

Thank you

Upvotes: 0

Views: 471

Answers (2)

Kevin Danikowski
Kevin Danikowski

Reputation: 5196

Had/have the same issue, symlinks isn't supported, you can avoid them by typing npm install --no-bin-links <package> but the problem is... babel requires the symlinks.

Best solution: Get rid of windows and get mac/linux

Possible Solution: I am going to try this soon and use digital ocean. Create digital ocean droplet, connect to it without using sym links, then connect this to docker, then run your files in docker. So symlinks will be allowed between docker and the droplet, but aren't necessary between your windows machine and the droplet.

If you try this let me know, otherwise I'll hopefully remember to come back and follow up!

Upvotes: 1

Joe Bank
Joe Bank

Reputation: 663

It looks like that Symlinks on shared volumes are not supported in Docker for Windows.

Upvotes: 0

Related Questions