question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

npm run serve command failed in a freshly made project created with @vue/cli. (Cannot find module '\node_modules\eslint\lib\api.js/package.json')

See original GitHub issue

Here’s what happened: Installed vue cli tool. created a project using it. tried to start the project with npm run serve according to docs. compile process failed, right out of the bat!

vi

Version

2.6.10

Reproduction link

https://github.com/m-ahmadi/vue-issue

Steps to reproduce

npm install @vue/cli -g && vue create test_app && default (babel, eslint) && cd test_app && npm run serve

What is expected?

That the app will be served on a local URL.

What is actually happening?

Compile process fails with 1 error: (Cannot find module ‘\node_modules\eslint\lib\api.js/package.json’)


OS: Windows 7 Ultimate Service Pack 1

node -v: v8.11.3 npm -v: 6.9.0 vue -V: 3.9.0

npm run serve

testvue2@0.1.0 serve E:\xampp\htdocs\testvue2 vue-cli-service serve

INFO Starting development server… 98% after emitting CopyPlugin

ERROR Failed to compile with 1 errors 20:56:38

Module build failed (from ./node_modules/eslint-loader/index.js): Error: Cannot find module ‘E:\xampp\htdocs\testvue2\node_modules\eslint\lib\api.js/package.json’ at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object.module.exports (E:\xampp\htdocs\testvue2\node_modules\eslint-loader\index.js:170:23)

You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
progsricommented, Aug 8, 2019

@furqon : This worked fo me. adding following to vue.config.js: module.exports = { lintOnSave: false, }

0reactions
furqoncommented, Jul 4, 2019

im using this solution: https://forum.vuejs.org/t/npm-run-serve-not-working-with-new-vue-cli-project/67939/11 and it works:


Steps I fixed it via yarn:

remove node_modules and yarn.lock add “resolutions”: { “eslint-loader”: “2.1.2” } to package.json run yarn install if it is still not working, try adding following to vue.config.js: module.exports = { lintOnSave: false, } as noted here 4 Hope it helps, it finally works for me. Good luck

Read more comments on GitHub >

github_iconTop Results From Across the Web

16 - Stack Overflow
Vue Cli : Cannot find module '../package.json' error after npm install · I experienced the same problem after moving the folder to a...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
This error occurs because of the following reasons: you're trying to import an item from a module you don't have installed in your...
Read more >
npm-ci
This command is similar to npm install , except it's meant to be used in automated environments such as test platforms, continuous integration,...
Read more >
Quick Start - Vue.js
npm init vue@latest. This command will install and execute create-vue, the official Vue project scaffolding tool. You will be presented with prompts for ......
Read more >
Installation - Nuxt
Here, you will find information on setting up and running a Nuxt project in 4 ... Make sure you have installed yarn, npx...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found