Encountering issues when attempting to install vue-cli on a new project

After creating an empty project, I attempted to install vue-cli using the command npm install -g @vue/cli. However, during the installation process, I encountered the following errors and warnings from the interpreter:

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
...
// Other deprecation warnings
...
npm ERR! code EEXIST
npm ERR! path C:\Users\yamar\AppData\Roaming\npm\node_modules\@vue\cli\bin\vue.js
npm ERR! dest C:\Users\yamar\AppData\Roaming\npm\vue.cmd
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\yamar\AppData\Roaming\npm\node_modules\@vue\cli\bin\vue.js' -> 'C:\Users\yamar\AppData\Roaming\npm\vue.cmd'
npm ERR! File exists: C:\Users\yamar\AppData\Roaming\npm\vue.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\yamar\AppData\Roaming\npm-cache\_logs\2021-09-23T08_16_52_330Z-debug.log

Question:
How can I resolve these issues and successfully install vue-cli?
P.S. Existing solutions from publicly available sources have not provided a fix.
Platform used: windows-10 pro, node v14.16.0

Answer №1

It seems like the NPM version you have installed is incorrect, causing compatibility issues.

For more information, check out this related post here

In my personal experience, I recommend managing node versions using nvm

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Retrieve the current element when the key is released and send it as a parameter to a different function

Imagine a scenario where my website contains textbox elements that are dynamically generated, each with the class 'mytxt'. <input type="text" class="mytxt" /> <input type="text" class="mytxt" /> <input type="text" class="mytxt" /& ...

Utilize Meteor-tabular to effortlessly export data with convenient HTML5 export buttons

Currently, I am utilizing the tabular package to display data from a collection in a table format. However, when attempting to export the data using html5 export buttons with the button (csvhtml5), only the length of data visible in the table is exported, ...

setting up default child route for vue-router tabs

I'm currently working on setting up a homepage that features tabs with 2 lists, one of which should be open by default. My route configuration looks like this; I've simplified the names for clarity: let routes = [{ path: '/', ...

How do I retrieve and display all the locally stored variables in Angular 2/JavaScript and calculate the total number of keys present in the localStorage?

Currently, I'm developing a project in Angular2 that involves the storage of user-added items to a shopping cart. To accomplish this, I have opted to utilize local storage to temporarily save the items. Each category (such as shoes, clothes, etc.) is ...

Quasar checkboxes for a multiple selection menu

I am working on creating a multi-select menu with checkbox options that is also filterable. You can check out a functional example provided by @Houssem here: https://codepen.io/HoussemDbira/pen/zYEgVmb The issue arises when trying to use v-model inside sc ...

Secure your website with the latest JWT cookie security measures

After storing a JWT with an expiry date set 30 days ahead, the question arises - is it secure to store this JWT in a cookie? The aim is for the token to persist beyond a single session, much like the "Keep me logged in" feature found on some websites. Se ...

Creating a dialog form using Vuetify in a VueJS application

Using the VueJS Vuetify framework, I am faced with a task of opening a dialog form - which is imported as a component template - from another template. When the ChangeMealDialog button in Meals.vue is clicked, the Modal should pop up. Below is the configur ...

Retrieve the item within the nested array that is contained within the outer object

I have a collection of objects, each containing nested arrays. My goal is to access the specific object inside one of those arrays. How can I achieve this? For instance, take a look at my function below where I currently log each array to the console. Wha ...

How can you decode JSON using JavaScript?

Need help with parsing a JSON string using JavaScript. The response looks like this: var data = '{"success":true,"number":2}'; Is there a way to extract the values success and number from this? ...

Informing the parent window of the child window's activities in order to adjust the timer for the user timeout feature

Within my Jquery function, I have implemented a feature that darkens the screen after a period of user inactivity. This triggers a pop-up window giving the user the option to stay logged in by clicking a button. If there is no response within the set time ...

The code snippets in the Vue3 documentation are quite peculiar

As I peruse the Vue 3 documentation, I notice a recurring pattern in how example code is presented for components: Vue.createApp({}) However, my experience with Vue 3 has been different. Instead of the above syntax, I simply use: <script> export d ...

Sails.js: Issue with unintended premature sending of 200 response before desired response is sent

While working with Sails.js version 1.2.3, I encountered an issue where I was unable to send data from a file as a response to a GET request over HTTP or WebSockets. It seems that regardless of whether I access the file synchronously or asynchronously in t ...

Dealing with 404 errors encountered when making requests to external websites, utilizing either basic Javascript or JQuery

I have links in my application that redirect to external websites. For example, a link might look like this: <http://www.google.com'>>General Search<>. Users input the href and we dynamically create the link without any validation of it ...

Retrieve data from a JSON file

I have a JSON file containing various player data, and I need to extract the "Name" field from it. { "player": [ { "Position": "TEST", "Name": "TEST", "Squad_No": "TEST", "Club": "TEST", "Age": "TEST" }, ...

What should you choose between vuex "store" and "data: store" in the Vue() constructor?

Vue documentation recommends using the "data" option in the constructor to maintain global or shared data: Link This approach seems logical and practical. Contrastingly, Vuex documentation initializes the "store" object without specifying a property name ...

Accessing the background page of a Chrome extension while it's in operation

I am in the process of developing my first chrome extension that allows youtube.com/tv to run in the background so it can be accessed easily on a phone or tablet. Everything is working fine, except for the fact that if I want to watch the video and not j ...

Function that returns an Observable<Boolean> value is null following a catch block

Why is the login status null instead of false in this method? // In the method below, I am trying to return only true or false. isLoggedIn(): Observable<boolean> { return this .loadToken() .catch(e => { this.logger ...

Automatically fill in form fields with data from a JSON file as soon as the user enters a value

How can I retrieve the bank name, branch, city, and district from a JSON array? Below is the contents of my results.json file: { "ifsc": [{ "ifsc": "PUNB0000100", "bank": "PUNJAB NATIONAL BANK", "city": "ABOHAR ...

Using jQuery to load a text file and dynamically insert it into a specified div

How can I load a *.txt file and insert the content into a div? Here is my code: JavaScript: $(document).ready(function() { $("#load").click(function() { $.ajax({ url : "file.txt", success : function (data) { ...

There seems to be an issue with the functionality of the AJAX file upload feature in

I've developed a method for file uploading using AJAX technology (pure JavaScript) in CodeIgniter. Here's how it works: 1- I created a script.js file to manage the AJAX/JavaScript upload process. 2- I implemented a controller in CodeIgniter to ...