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.

Cannot find module 'vue-template-compiler/package.json'

See original GitHub issue

Version

3.0.0-rc.11

Node and OS info

node v10.8.0, npm 6.2.0, macOS High Sierra

Steps to reproduce

create empty project and try to serve it vue create test -p default && cd test && vue serve src/main.js

What is expected?

serving empty project

What is actually happening?

Error: Cannot find module 'vue-template-compiler/package.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at api.chainWebpack.webpackConfig (/usr/local/lib/node_modules/@vue/cli-service-global/node_modules/@vue/cli-service/lib/config/base.js:61:32)
    at webpackChainFns.forEach.fn (/usr/local/lib/node_modules/@vue/cli-service-global/node_modules/@vue/cli-service/lib/Service.js:209:40)
    at Array.forEach (<anonymous>)
    at Service.resolveChainableWebpackConfig (/usr/local/lib/node_modules/@vue/cli-service-global/node_modules/@vue/cli-service/lib/Service.js:209:26)
    at Service.resolveWebpackConfig (/usr/local/lib/node_modules/@vue/cli-service-global/node_modules/@vue/cli-service/lib/Service.js:213:48)
    at PluginAPI.resolveWebpackConfig (/usr/local/lib/node_modules/@vue/cli-service-global/node_modules/@vue/cli-service/lib/PluginAPI.js:115:25)

npm run server (which is linked to vue-cli-service serve) works, but vue serve should also work according to vue serve --help

Issue Analytics

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

github_iconTop GitHub Comments

127reactions
OrenciucEvgheniicommented, Sep 24, 2021

I DONT SPEAK CHINESE FFS

45reactions
sodateacommented, Aug 8, 2018

Since rc.11 we make vue-template-compiler a peer dependency of @vue/cli-service, so installing @vue/cli-service-global won’t automatically install vue-template-compiler.

A temporary workaround is to manually run npm i -g vue-template-compiler

Read more comments on GitHub >

github_iconTop Results From Across the Web

upgrade to vue3 Cannot find module 'vue-template-compiler ...
Error: Cannot find module 'vue-template-compiler/package.json' Require stack: - /myproject/node_modules/@vue/cli-service/lib/config/base.js - / ...
Read more >
vue-template-compiler - npm
This package can be used to pre-compile Vue 2.0 templates into render functions to avoid runtime-compilation overhead and CSP restrictions.
Read more >
Cannot find module '@vue/compiler-sfc/package.json'
When upgrading to vue 3 with : yarn add vue@next. I get this error: “Cannot find module '@vue/compiler-sfc/package.json”
Read more >
Fatal Error: Cannot find module 'vue/package.json' - Issuehunt
npx vue-cli init ./wemake-vue-template my_test_app · Installed nvm · nvm install · nvm use · npm install · Copied and modified environment file...
Read more >
Error: Cannot find module 'vue-template-compiler/package ...
Error: Cannot find module 'vue-template-compiler/package.json'
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