docker チュートリアルでエラー
解決したいこと
dockerのチュートリアルでエラーが発生しました
$ docker build --tag bulletinboard:1.0 .
の部分です
発生している問題・エラー
以下Docker quick start terminalのエラー
npm noticeとnpm ERR!
User MINGW64 ~/.docker/tutorial/node-bulletin-board/bulletin-board-app (master)
$ docker build --tag bulletinboard:1.0 .
Sending build context to Docker daemon 45.57kB
Step 1/7 : FROM node:current-slim
---> 922b09b21278
Step 2/7 : WORKDIR /usr/src/app
---> Using cache
---> 5d3d82eda8ed
Step 3/7 : COPY package.json .
---> Using cache
---> 9cbfaca08ae9
Step 4/7 : RUN npm install
---> Running in 966ccb4e7ce7
npm notice
npm notice New patch version of npm available! 7.0.3 -> 7.0.8
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.0.8>
npm notice Run `npm install -g npm@7.0.8` to update!
npm notice
npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/vue reason: Unexpected token in JSON at position 26452
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-11-04T12_52_38_113Z-debug.log
The command '/bin/sh -c npm install' returned a non-zero code: 1
自分で試したこと
Node.jsのインストールと上のディレクトリにpath設定?してみましたが
User MINGW64 ~/.docker/tutorial/node-bulletin-board/bulletin-board-app (master)
$ npm install -g npm@7.0.8
bash: npm: command not found
こんな感じです
windows環境変数->system variable-> pathにC:\Program Files\nodejs\は追加してあります
package jsonもあまりよくわかりません
全くの初心者なので、何かご助言いただけるとありがたいです
(情報足りなかったらすみません)
補足
package-lock.jsonファイルをdeleteしたら以下のようになりました
$ docker build --tag bulletinboard:1.0 .
Sending build context to Docker daemon 12.03MB
Step 1/7 : FROM node:current-slim
---> 922b09b21278
Step 2/7 : WORKDIR /usr/src/app
---> Using cache
---> 5d3d82eda8ed
Step 3/7 : COPY package.json .
---> Using cache
---> 7cc831630440
Step 4/7 : RUN npm install
---> Running in 1a42d2b3c5dd
npm WARN tar TAR_ENTRY_INVALID checksum failure
npm WARN tar TAR_ENTRY_INVALID checksum failure
npm WARN tar TAR_ENTRY_INVALID checksum failure
npm WARN tar TAR_ENTRY_INVALID checksum failure
npm WARN tar TAR_ENTRY_INVALID checksum failure
npm WARN tar zlib: incorrect data check
npm WARN tarball tarball data for send@https://registry.npmjs.org/send/-/send-0.17.1.tgz (sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==) seems to be corrupted. Trying again.
added 91 packages, and audited 91 packages in 7s
found 0 vulnerabilities
Removing intermediate container 1a42d2b3c5dd
---> 08004402de84
Step 5/7 : EXPOSE 8080
---> Running in b734713b7913
Removing intermediate container b734713b7913
---> 4f780ddcd401
Step 6/7 : CMD [ "npm", "start" ]
---> Running in e64ddc6fef15
Removing intermediate container e64ddc6fef15
---> bc336232b3a6
Step 7/7 : COPY . .
---> 1be64837dbd3
Successfully built 1be64837dbd3
Successfully tagged bulletinboard:1.0
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.