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 'typescript'

See original GitHub issue

When running Cypress v3.1.4 β€œon its own”, things work fine, but if I add in @percy/cypress 0.2.3, things suddenly go wrong:

C:\Users\Pomax\Documents\Git\collaborations\mozilla\foundation.mozilla.org>npm run percy

> network@1.0.0 percy C:\Users\Pomax\Documents\Git\collaborations\mozilla\foundation.mozilla.org
> percy exec -- npm run cypress

module.js:549
    throw err;
    ^

Error: Cannot find module 'typescript'
    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.<anonymous> (J:\Junctions\Users\Mike\Documents\Git\collaborations\mozilla\foundation.mozilla.org\node_modules\@oclif\config\lib\ts-node.js:5:22)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! network@1.0.0 percy: `percy exec -- npm run cypress`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the network@1.0.0 percy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

This worked fine before (where β€œbefore” was actually just a few hours ago), but I’m also seeing this go wrong on Travis CI now:

image

(We had to add a separate npm i typescript to our Travis setup, outside of the package.json, to get things to work)

Any idea why all of a sudden typescript is causing failures?

Cypress run without percy:

C:\Users\Pomax\Documents\Git\collaborations\mozilla\foundation.mozilla.org>npm run cypress

> network@1.0.0 cypress C:\Users\Pomax\Documents\Git\collaborations\mozilla\foundation.mozilla.org
> run-p --race server cypress:test


> network@1.0.0 server C:\Users\Pomax\Documents\Git\collaborations\mozilla\foundation.mozilla.org
> pipenv run python network-api/manage.py runserver


> network@1.0.0 cypress:test C:\Users\Pomax\Documents\Git\collaborations\mozilla\foundation.mozilla.org
> wait-on tcp:8000 && cypress run

Loading .env environment variables…
Performing system checks...

System check identified no issues (0 silenced).
January 30, 2019 - 14:24:31
Django version 1.11.18, using settings 'networkapi.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.


====================================================================================================

  (Run Starting)

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ Cypress:    3.1.4                                                                              β”‚
  β”‚ Browser:    Electron 59 (headless)                                                             β”‚
  β”‚ Specs:      2 found (multi-page.js, single-page.js)                                            β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


────────────────────────────────────────────────────────────────────────────────────────────────────

  Running: multi-page.js...                                                                (1 of 2)


  multipage visual regression tests
2019-01-30 14:24:52,749 [INFO] "GET /en/campaigns/multi-page/ HTTP/1.1" 200 13332
[...snip...]
2019-01-30 14:24:53,313 [INFO] "GET /environment.json HTTP/1.1" 200 235
    √ Loads the multipage campaign correctly (13362ms)


  1 passing (13s)


  (Results)

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ Tests:        1             β”‚
  β”‚ Passing:      1             β”‚
  β”‚ Failing:      0             β”‚
  β”‚ Pending:      0             β”‚
  β”‚ Skipped:      0             β”‚
  β”‚ Screenshots:  0             β”‚
  β”‚ Video:        false         β”‚
  β”‚ Duration:     13 seconds    β”‚
  β”‚ Spec Ran:     multi-page.js β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


────────────────────────────────────────────────────────────────────────────────────────────────────

  Running: single-page.js...                                                               (2 of 2)


  Integration test with visual testing
2019-01-30 14:25:07,509 [INFO] "GET / HTTP/1.1" 302 0
[...snip...]
2019-01-30 14:25:08,001 [INFO] "GET /_images/buyers-guide/earth.jpg HTTP/1.1" 200 195144
    √ Loads the homepage (12986ms)


  1 passing (13s)


  (Results)

  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ Tests:        1              β”‚
  β”‚ Passing:      1              β”‚
  β”‚ Failing:      0              β”‚
  β”‚ Pending:      0              β”‚
  β”‚ Skipped:      0              β”‚
  β”‚ Screenshots:  0              β”‚
  β”‚ Video:        false          β”‚
  β”‚ Duration:     13 seconds     β”‚
  β”‚ Spec Ran:     single-page.js β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜


====================================================================================================

  (Run Finished)


      Spec                                                Tests  Passing  Failing  Pending  Skipped
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚ √ multi-page.js                             00:13        1        1        -        -        - β”‚
  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
  β”‚ √ single-page.js                            00:13        1        1        -        -        - β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
    All specs passed!                           00:26        2        2        -        -        -

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Robdel12commented, May 15, 2019

Woop! Happy to hear that. If it does happen again I’d love to hear about it.

0reactions
Pomaxcommented, May 15, 2019

I’ve not seen it happen recently, no. Closing until (if) it happens again

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find module 'typescript' Error in TS | bobbyhadz
To solve the cannot find module 'typescript' error, make sure to install typescript globally by running the npm i -g typescript command and...
Read more >
How to fix Cannot find module 'typescript' in Angular 4?
3. Hi @Sajeetharan I have installed it globall using your command above. Β· 1. try to uninstall angular-cli globally, run npm cache clean...
Read more >
Error: Cannot find module 'typescript' from 'P:\FORGE\JPMC ...
It seems it's not able to find the typescript module from node_modules , meaning that you don't have typescript installed. ... And finally...
Read more >
Error: Cannot find module 'typescript' - Sonar Community
Error : Cannot find module 'typescript' Β· (Recommended) Running npm install before starting an analysis on each of your TS project to makeΒ ......
Read more >
Fix error: cannot find module 'x' in Node.js or 'express'
Also, you can fix the Cannot find module 'X' Error in TypeScript project by installing type definitions for all your packages the project...
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