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' from 'vue-test-utils.js'

See original GitHub issue

Version

1.0.0-beta.30

Reproduction link

https://github.com/wemake-services/wemake-vue-template

Steps to reproduce

  1. Create new project using this boilerplate
  2. Install dependencies
  3. Run npm test

What is expected?

I expect everything to work as it was before the -beta.30

What is actually happening?

Link to the failing CI: https://travis-ci.com/wemake-services/wemake-vue-template/builds/143178639 Now I have an exception:

> cross-env NODE_ENV=test jest

 FAIL  tests/components/action-bar.spec.ts
  ● Test suite failed to run

    Cannot find module 'vue-template-compiler' from 'vue-test-utils.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17)
      at Object.<anonymous> (node_modules/@vue/test-utils/dist/vue-test-utils.js:5:27)

 FAIL  tests/components/comment.spec.ts
  ● Test suite failed to run

    Cannot find module 'vue-template-compiler' from 'vue-test-utils.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17)
      at Object.<anonymous> (node_modules/@vue/test-utils/dist/vue-test-utils.js:5:27)

 FAIL  tests/pages/index.spec.ts
  ● Test suite failed to run

    Cannot find module 'vue-template-compiler' from 'vue-test-utils.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17)
      at Object.<anonymous> (node_modules/@vue/test-utils/dist/vue-test-utils.js:5:27)

----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |        0 |        0 |        0 |        0 |                   |
----------|----------|----------|----------|----------|-------------------|
Test Suites: 3 failed, 3 total
Tests:       0 total
Snapshots:   0 total
Time:        9.111s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! name@0.0.0 test:unit: `cross-env NODE_ENV=test jest`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the name@0.0.0 test:unit script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sobolev/.npm/_logs/2020-01-09T13_49_48_645Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! name@0.0.0 test: `npm run test:engine && npm run test:unit && npm run lint`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the name@0.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sobolev/.npm/_logs/2020-01-09T13_49_48_684Z-debug.log
> cross-env NODE_ENV=test jest

 FAIL  tests/components/action-bar.spec.ts
  ● Test suite failed to run

    Cannot find module 'vue-template-compiler' from 'vue-test-utils.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17)
      at Object.<anonymous> (node_modules/@vue/test-utils/dist/vue-test-utils.js:5:27)

 FAIL  tests/components/comment.spec.ts
  ● Test suite failed to run

    Cannot find module 'vue-template-compiler' from 'vue-test-utils.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17)
      at Object.<anonymous> (node_modules/@vue/test-utils/dist/vue-test-utils.js:5:27)

 FAIL  tests/pages/index.spec.ts
  ● Test suite failed to run

    Cannot find module 'vue-template-compiler' from 'vue-test-utils.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:259:17)
      at Object.<anonymous> (node_modules/@vue/test-utils/dist/vue-test-utils.js:5:27)

----------|----------|----------|----------|----------|-------------------|
File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files |        0 |        0 |        0 |        0 |                   |
----------|----------|----------|----------|----------|-------------------|
Test Suites: 3 failed, 3 total
Tests:       0 total
Snapshots:   0 total
Time:        9.111s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! name@0.0.0 test:unit: `cross-env NODE_ENV=test jest`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the name@0.0.0 test:unit script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sobolev/.npm/_logs/2020-01-09T13_49_48_645Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! name@0.0.0 test: `npm run test:engine && npm run test:unit && npm run lint`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the name@0.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sobolev/.npm/_logs/2020-01-09T13_49_48_684Z-debug.log


Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sobolevncommented, Jan 11, 2020

It was related to 10 -> 12 node migration process: https://github.com/wemake-services/wemake-vue-template/compare/aedfddb452bf...1165ffb99cb8

Thanks!

0reactions
viT-1commented, Jan 28, 2022

Why vue-template-compiler listed in peer dependencies? I’m using vue components without .vue files (templates as strings in js) and I don’t need in vue-template-compiler functionality for my project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Test suite failed to run Cannot find module 'vue-template ...
If I do install that vue-template-compiler package I get the error of version mismatching. Anyone that found a solution to this problem yet...
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 >
cannot find module '@vue/compiler-dom' from 'node_modules ...
Subject of the issue. im using nuxt to the project first i using test utils version 1.1.2 it work fine for testing vuex...
Read more >
Fatal Error: Cannot find module 'vue/package.json' - Issuehunt
This is when the error "FATAL Cannot find module 'vue/package.json'" shows up. ... run Cannot find module 'vue-template-compiler' from 'vue-test-utils.js' ...
Read more >
vue-template-compiler - npm
For pull requests please see src/platforms/web/entry-compiler.js. This package can be used to pre-compile Vue 2.0 templates into render ...
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