internal/modules/CJS/loader. The js: 638
throw err;
^
Error: always find module 'semver
Feel very strange, and install in Dockerfile semver or the same problem, refer to the online information, when you say, this module should be nodejs's own, so why didn't the docker nodejs this module,
Labeled Dockerfile file
FROM the node: 10.16.3
# if you are at home, the line configuration is necessary, otherwise the package will be very, very slowly, because, all understand,
The RUN NPM config set registry https://registry.npm.taobao.org
# install simple HTTP server for serving static content
The RUN NPM install - - g HTTP server
# make the 'app' folder to the current working directory
WORKDIR/app
# copy to both 'package. Json' and 'package - lock. Json (if available)
The COPY package *. Json.
# install project dependencies
The RUN yarn install
# copy project files and folders to the current working directory (i.e. for 'app' folder)
COPY.
# build app for production with minification
The RUN yarn build
EXPOSE 8080
# to join port custom configuration, to avoid conflict with other K8S container port
CMD [" HTTP server - ", "-p", "8080", "dist"]
CodePudding user response:
You this estimate is no default installation package inside, find a compiled version of the compiled by oneself, into the tar packages, in dockerfile again ADD directly added into the environment should be,CodePudding user response: