installing @vue/cli-service flipflops the lockfile
See original GitHub issueVersion
4.5.7
Reproduction link
https://github.com/doppelreim/install-vue-cli-service
Environment info
vue is not involved - only package `@vue/cli-service`. I did this to zero in on the issue.
Steps to reproduce
I used a container for the dev-environment (node and npm) (see README).
- Run
npm install
Bonus steps:
- Delete directory
node_modules
- Run
npm install
- Repeat
- Observe that the lockfile flipflops between two states
What is expected?
File package-lock.json
should not be changed.
What is actually happening?
File package-lock.json
is changed.
I documented the whole investigation in the README of the repro-repo.
We ran into this bug at work, because different developers are constantly getting unexpected changes to file package-lock.json
.
This creates uncertainty and confusion and makes reviews harder.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Installation | Vue CLI
To install the new package, use one of the following commands. You need administrator privileges to execute these unless npm was installed on ......
Read more >npm vs Vue CLI | What are the differences? - StackShare
I use Yarn because it outputs nice progress messages with cute emoji and installs packages quickly if the package is cached. Also, Yarn...
Read more >@vue/cli | Yarn - Package Manager
Command line interface for rapid Vue.js development. vue, cli. readme. @vue/cli. npm install -g @vue/cli vue create my-project ... @vue/cli-service.
Read more >Install vue/cli and vue/cli-service-global through package.json?
In your package.json under scripts you need to add preinstall script which will execute preinstall scripts every time you do npm install ......
Read more >How to Use Vue CLI for Easier VueJS Project Management
You will learn about both here. Installing Vue CLI 3.0 Globally. If you have previously installed vue-cli , v1.x or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I reported the issue to npm as well.
I could imagine that the behaviour might be caused by the optional dependency on a second/different version of package
vue-loader
(https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/package.json#L83). Because the packages that get shifted around in the lockfile are dependencies of that one, if I remember correctly.My understanding of
npm ci
was, that it is intended to be used on CI?@doppelreim - i see your question on npm got closed. I’m facing the same issue. I don’t see any reason for npm install to ever change the lock file. That should never happen imho. I have a local build using npm 6.14.12 - no problems. Than on the production server, using the same version, it changes my package-lock - making the git checkout ‘changed’. It only changes the order of entries. Why? Why is there code in npm install that is even able to change the package-lock? I’m currently not upgrading to V7 on my prod server, that might have too many effects on other applications. So as a fix for now after build in production (end of my CI/CD chain) i do a quick git checkout . to revert. One difference: in prod i use
vue-cli buildvue-cli build
in development it’svue-cli-service build --mode development
could that explain this behavior maybe?