【发布时间】:2020-01-14 06:05:07
【问题描述】:
我最近在处理我正在处理的 Web 项目时遇到了一些问题,并试图删除 node_modules 文件夹。但是在从头开始删除并重新安装它之后,我根本无法构建项目,既不能用于开发,也不能用于生产。当我运行npm run dev 时,出现以下错误:
macbook:coolapp-web-fe.v2 anatolyt$ PORT=8087 npm run dev
> coolapp@2.0.45 dev /Users/anatolyt/work/coolapp-web-fe.v2
> webpack-dev-server --inline --watch --progress --config build/webpack.dev.conf.js
19% building modules 82/115 modules 33 active ...partials/pages-carcass/flex-block.vue{ parser: "babylon" } is deprecated; we now treat it as 65% building modules 506/548 modules 42 active .../partials/table/colorBarVariables.vue^C^C^C
macbook:coolapp-web-fe.v2 anatolyt$ PORT=8087 npm run dev
> coolapp@2.0.45 dev /Users/anatolyt/work/coolapp-web-fe.v2
> webpack-dev-server --inline --watch --progress --config build/webpack.dev.conf.js
19% building modules 82/115 modules 33 active ...src/components/partials/card-wrap.vue{ parser: "babylon" } is deprecated; we now treat it as 63% building modules 499/564 modules 65 active ...2/node_modules/moment/locale/zh-hk.js^C^C^C
macbook:coolapp-web-fe.v2 anatolyt$ PORT=8087 npm run dev
> coolapp@2.0.45 dev /Users/anatolyt/work/coolapp-web-fe.v2
> webpack-dev-server --inline --watch --progress --config build/webpack.dev.conf.js
19% building modules 82/115 modules 33 active ...rc/components/partials/form-group.vue{ parser: "babylon" } is deprecated; we now treat it as 65% building modules 986/1057 modules 71 active ...headerGroup/headerGroupWrapperComp.js
当我通过运行以下代码为开发(构建 Docker 的映像)构建项目时:
FROM node:8-alpine as builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm set progress=false && npm config set depth 0 && npm cache clean --force
RUN npm i --production
在最后一行 RUN npm i --production 我收到以下错误:
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/core-js-967e32e1/client/library.js'
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/vue-form-wizard-25ea249a/src/components/WizardButton.vue'
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/vue-form-wizard-25ea249a/src/components/WizardStep.vue'
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/ag-grid-vue-df63d144/gulpfile.js'
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/ag-grid-vue-df63d144/LICENSE.txt'
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/ag-grid-vue-df63d144/main.js'
我知道它的错误范围太广,并且可能会导致各种问题,但至少有一些提示如何调试此问题会有所帮助。
我试图删除packaga-lock.json,但没有帮助。
【问题讨论】:
标签: node.js vue.js npm webpack