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]
- Probably there is a image with this name.
- Terminal is referencing a script, application or .exe file named 'Docker' ('Docker.js', probably. From a documentation (?))
- You probably installed a library, extension or aplication that starts with 'doc../' and is referencing that.
- 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:
- Install any other version of
Node
through nvm
, if you don't have it donwload it:
nvm install 14
nvm use 14
- Uninstall the other Node version, that you plan on using:
nvm uninstall 18
- 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
- Just to be sure, just cuz im not an expert, do it again:
npm uninstall -g docker
- 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)
- 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)
Delete package-lock.json
(Not the package.json)
Delete node_modules
folder
Check the dependencies
and devDependencies
properties for any unknown, unused or unwanted command-line tool
, plugin
, extension
run npm i
to re-install the core file/folders you deleted
Don't use npm ci
because it reflects the package-lock.json
file and it is deleted at this point
Check the versions of any plugin, etc, you'd like to use, and re-install them if necessary
By this point, everything should be normal, and this error should disappear (yey)
If you want to make sure, or use my specs:
- 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)
- 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.