Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Module build failed: Error: Cannot find module 'typescript' -- Missing dependency in package.json? #110

Closed
@alshain

Description

@alshain

Description

After upgrading react-scripts-ts with npm install -D react-scripts-ts@2.4.0 from 2.2.0, I get an error when compiling using npm 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:

  1. npm ls react-scripts-ts (if you haven’t ejected):

`-- react-scripts-ts@2.4.0

  1. node -v: v7.7.4
  2. npm -v: 5.3.0

Then, specify:

  1. Operating system: Win 7 x86
  2. Browser and version: irrelevant

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 generated package.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions