Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

485
Visualizações
Vetur can't find package.json

I was writing code for my app with Vue and everything worked perfectly. Then I started to create child components and I could not refresh the localhost anymore.

Now it says:

"Vetur can't find 'package.json" & "Vetur can't find 'tsconfig.json' or 'jsconfig.json"

and when I try to "npm run serve" in the cmd - then i get this:

C:\Users\cmana\Desktop\WebDeveloper\Vue app\vuetify-todo>npm run serve
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\cmana\Desktop\WebDeveloper\Vue app\vuetify-todo\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\cmana\Desktop\WebDeveloper\Vue app\vuetify-todo\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\cmana\AppData\Roaming\npm-cache\_logs\2021-04-07T12_03_13_953Z-debug.log

Acording to this https://vuejs.github.io/vetur/guide/setup.html#project-setup - I tried to add the jsconfig.json file with this content. (I deleted all the child components so I only have these vue files (About, Todo, App) left.)

{
  "include": [
    "./src/views/About.vue",
    "./src/views/Todo.vue",
    "./src/App.vue"
  ]
}

Still nothing. Anybody any ideas? Thank you <3

over 4 years ago · Santiago Trujillo
5 Respostas
Responde à pergunta

0

Installing the EsLint extension should solve your problem

if you are on VS Code, search for the EsLint extension by publisher:"Dirk Baeumer", install it and approve the installation to start the EsLint server

Alternatively run this in the terminal npm install eslint in your workspace

The package.json file gets modified and your server will be up again

for further information on the EsLint extension you can check https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint

Good luck!

over 4 years ago · Santiago Trujillo Relatório

0

in VSCode

ctrl + p
open setting.json
add this line:

  "vetur.ignoreProjectWarning": true,

this will ignore the error.

over 4 years ago · Santiago Trujillo Relatório

0

First of all, in Visual Studio code, type:

Ctrl + Shift + p

This command, will open this window

enter image description here

Type: settings json in search bar, like this:

enter image description here

Open the first option: "Open Settings (JSON)".

Now, on JSON file, add this: "vetur.ignoreProjectWarning": true, in the end of file, like this:

enter image description here

Restart Visual Studio Code and you're done!

over 4 years ago · Santiago Trujillo Relatório

0

Add "vetur.config.js" outside your project.

In this example below, "vetur.config.js" is added outside the project "vueProject":

enter image description here

Shrinking "vueProject" looks clearer:

enter image description here

Then, paste this code below to "vetur.config.js":

// vetur.config.js
/** @type {import('vls').VeturConfig} */
module.exports = {
  // **optional** default: `{}`
  // override vscode settings
  // Notice: It only affects the settings used by Vetur.
  settings: {
    "vetur.useWorkspaceDependencies": true,
    "vetur.experimental.templateInterpolationService": true
  },
  // **optional** default: `[{ root: './' }]`
  // support monorepos
  projects: [
    './packages/repo2', // shorthand for only root.
    {
      // **required**
      // Where is your project?
      // It is relative to `vetur.config.js`.
      root: './packages/repo1',
      // **optional** default: `'package.json'`
      // Where is `package.json` in the project?
      // We use it to determine the version of vue.
      // It is relative to root property.
      package: './package.json',
      // **optional**
      // Where is TypeScript config file in the project?
      // It is relative to root property.
      tsconfig: './tsconfig.json',
      // **optional** default: `'./.vscode/vetur/snippets'`
      // Where is vetur custom snippets folders?
      snippetFolder: './.vscode/vetur/snippets',
      // **optional** default: `[]`
      // Register globally Vue component glob.
      // If you set it, you can get completion by that components.
      // It is relative to root property.
      // Notice: It won't actually do it. You need to use `require.context` or `Vue.component`
      globalComponents: [
        './src/components/**/*.vue'
      ]
    }
  ]
}
over 4 years ago · Santiago Trujillo Relatório

0

In VS Code, if the actual code is in a subfolder (e.g you have a monorepo), you can add a vetur.config.js in the root directory as per below.

module.exports = {
    projects: [
      {
        root: './frontend', // root of your vue project (should contain package.json)
        package: './package.json', // Relative to root property, don't change this.
        tsconfig: './tsconfig.json',  // Relative to root property, don't change this.
      }
    ]
  }

Please refer to Vetur Reference for more details.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda