5

I've installed Docker following exactly the documentation on the website but when I try to run docker run hello-world, I get the following output from the terminal:

Saved file tree to doc-filelist.js
Copied JS to doc-script.js
Compiled CSS to doc-style.css

Does anybody have an idea what is going wrong?

javabatz
  • 223
  • 1
  • 4
  • 9
  • Um... what? Can't replicate at all. – Jonnix Nov 18 '16 at 11:22
  • 1
    You're almost certainly running into another utility that's also called 'docker' in your path. We need more information to help you. What operating system are you trying to install 'docker' on? Assuming It's a Linux system, what distribution? Which instructions did you follow? – TinkerTank Nov 18 '16 at 13:39
  • I have the same problem. Thank you for posting! – joncodo Oct 11 '17 at 23:58
  • similar problem here: https://stackoverflow.com/questions/75248938/i-cant-run-docker-on-cmd-saved-file-tree-to-doc-filelist-js-copied-js-to-doc-s/76064804#76064804 – john k Apr 20 '23 at 15:45

3 Answers3

16

Is it possible that you have docker.js installed locally?

The output from your command looks like the docker.js docker executable is called instead of the Docker container one.

The log messages that you showed can be found in the docker.js documentation, it looks like you're running that instead of the one you want.

If this is the issue run npm uninstall -g docker

Paul Fitzgerald
  • 11,770
  • 4
  • 42
  • 54
nwinkler
  • 52,665
  • 21
  • 154
  • 168
  • Thank you very much- that was exactly the problem...after removing the docker.js via npm my problem was solved! – javabatz Nov 18 '16 at 15:06
0

I was experiencing the same issue, and it turned out to be caused by running nvm (node version manager). When I used nvm to run Node, Docker was not recognized. However, when I removed nvm, Docker worked as expected. I'm sure there's a workaround to make nvm and Docker work together, and I'll look into that later so I can continue using both tools.

Ying-Shan Lin
  • 607
  • 5
  • 22
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 21 '23 at 23:44
0

Got this error and, as a >newbie< dev, I searched everywhere for an answer, this is what I found:

>Be aware< :

Doing this didn't affect any of my projects, but don't know if it is always the case. I collected online info and asked some of my teachers and co-workers, but neither of them are used to Docker, so some of these steps may be unnecessary.

First make sure you are using the correct shell and profile and if you have the Docker, docker-compose, Node, npm and nvm installed properly, Docker has a Desktop Version that can help with troubleshooting and administration in the future -> ["Docker Desktop Installer.exe"][1]

  1. Probably there is a image with this name.
  2. Terminal is referencing a script, application or .exe file named 'Docker' ('Docker.js', probably. From a documentation (?))
  3. You probably installed a library, extension or aplication that starts with 'doc../' and is referencing that.
  4. Docker is not installed properly and not recognized.

Maybe those assumptions are wrong but here is the way I solved this problem, hope this helps:

  1. Install any other version of Node through nvm, if you don't have it donwload it:
nvm install 14
nvm use 14
  1. Uninstall the other Node version, that you plan on using:
nvm uninstall 18
  1. Remove anything locally called docker, be careful with files that may matter to you
npm uninstall -g docker \
npm remove docker \
npm remove dockerjs \
npm remove docker.js \
npm remove dock \
npm remove doc \
npm remove docker.js 
  1. Just to be sure, just cuz im not an expert, do it again:
npm uninstall -g docker
  1. Download again the version of Node you'd like to use:
nvm install node (Will install the latest version of Node [curr@19.7.0])
nvm install 18 (To install v18)(nvm install 14; to install v14)
  1. Use the version you'd like to run:
nvm use node (Will switch/use the latest version of Node [curr@19.7.0])
nvm use 18  (Will switch/use the version you describe)
  1. Delete package-lock.json (Not the package.json)

  2. Delete node_modules folder

  3. Check the dependencies and devDependencies properties for any unknown, unused or unwanted command-line tool, plugin, extension

  4. run npm i to re-install the core file/folders you deleted

  5. Don't use npm ci because it reflects the package-lock.json file and it is deleted at this point

  6. Check the versions of any plugin, etc, you'd like to use, and re-install them if necessary

  7. By this point, everything should be normal, and this error should disappear (yey)

If you want to make sure, or use my specs:

  1. Check if the versions are correct and compatible on terminal:
npm -v \
9.5.0    (curr@v9.5.0)

node -v \
v19.7.0  (curr@v19.7.0)

nvm -v \
0.39.0   (curr@v0.39.0)
  1. Test if 'docker commands' are working on the terminal:

docker version

--Output:

Client: Docker Engine - Community
 Cloud integration: v1.0.31
 Version:           20.10.23
 API version:       1.41
 Go version:        go1.18.10
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Desktop
 Engine:
  Version:          20.10.23
  API version:      1.41 (minimum version 1.12)
  OS/Arch:          linux/amd64
  containerd:
  Version:          1.6.18

 runc:
  Version:          1.1.4

 docker-init:
  Version:          0.19.0

***I OMMITED SOME OF THE OUTPUT OR IT WOULD BE TOO LONG***

And for docker-composer:

docker-composer -v

--Output:

Docker Compose version v2.15.1

Test other commands such as: docker ps

--Output:

CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

docker-compose up --build

--Result:

Builds, (re)creates, starts, and attaches to containers for a service.