-
Notifications
You must be signed in to change notification settings - Fork 492
Module build failed: Error: Cannot find module 'typescript' -- Missing dependency in package.json? #110
Comments
As this issue hasn't been updated for a while, I am going to close it. If there are any updates feel free to re-open and comment. 👍 |
Well, I was waiting for feedback from you, what updates did you expect? Is it correct that the generated package.json shouldn't contain a typescript dependency? |
Just wanted to add something I figured out on this issue. I was experiencing it suddenly on Angular 5 app that had been working. Lot of trial and error...it turns out that it was not happy I had a camel case ts file (vProperty.ts) OR that the add on I was using like to do a './../..' instead of '../..'. for the import Changing both of these and the problem went away. However what is really strange...I still have a LOT of instances of this (which I am in the process of refactoring..that still work. |
Description
After upgrading react-scripts-ts with
npm install -D [email protected]
from2.2.0
, I get an error when compiling usingnpm start
Expected behavior
I expect things to work :)
Actual behavior
I get
Module build failed: Error: Cannot find module 'typescript'
Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts-ts
(if you haven’t ejected):node -v
: v7.7.4npm -v
: 5.3.0Then, specify:
Suspected cause and how I fixed it:
Eventually, I fixed it by installing the
typescript
module locally.I initialized a new sample project with create-react-app. I noticed that it contained a locally installed
typescript
module. However, said module was not listed in the freshly generatedpackage.json
.After running
npm install -S typescript
, things started working again.Related: #106 but deleting node_modules and re-running
npm install
didn't fix things for me. Having typescript installed globally didn't help either.The text was updated successfully, but these errors were encountered: