[Vuejs]-Can't build VueJS webpack based project after removing node_modules folder

0👍

Ok, I found the reason why Docker’s image wasn’t building with the following error:

npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/vue-form-wizard-25ea249a/src/components/WizardStep.vue'

We have a private npm module which requires that username and password will be specified in .npmrc file. I forget to include this file in Docker image.

When I changed the following line:

COPY package.json package-lock.json ./

to

COPY package.json package-lock.json .npmrc ./

Everything began to work.

The only issue which remained, if I remove a package-lock.json and run npm install from the scratch npm run dev command hangs later. When I restore a package-lock.json older version from a git, it works fine. It’s definitely packet conflicts, but I can’t understand which one right now.

UPDATE Regarding package-lock.json issue. It’s created at the point when npm install was run fist time and it keeps dependencies relevant at that point of time, read here what does it do for details. Since then some dependencies have been changed and this caused to breaking changes. You can compare package-lock.json generated then and now, see the differences in versions and try to catch one which breaks the building. Another option is to use this fork of npm npm install –time-machine (ignore packages released after a given date) and try to run npm install at different point of time to look when the issue begins. I haven’t used it yet, but hopefully will use it and will update my answer here.

Leave a comment