Cannot find module 'typescript'
See original GitHub issueWhen 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:
(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:
- Created 5 years ago
- Comments:8 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Woop! Happy to hear that. If it does happen again Iβd love to hear about it.
Iβve not seen it happen recently, no. Closing until (if) it happens again