Skip to content

Module not found: Can't resolve 'react' #2534

Closed
@p-adams

Description

@p-adams

I am currently facing this problem when I attempt to install any node package into an app created with create-react-app:

`npm WARN gentlyRm not removing /Users/user/Desktop/mobx-shopping/node_modules/espree/node_modules/.bin/acorn as it wasn't installed by /Users/user/Desktop/mobx-shopping/node_modules/espree/node_modules/acorn
npm notice created a lockfile as package-lock.json. You should commit this file.

npm WARN [email protected] requires a peer of react@^0.13.0 || ^0.14.0 || ^15.0.0 || ^16.0.0-0 but none was installed.`

Then when I run the app with npm start and it compiles, I get the following error:

 Failed to compile.
 ./src/index.js
 Module not found: Can't resolve 'react' in '/Users/user/Desktop/mobx-shopping/src'

Node version: 8.0.0
NPM version: 5.0.3
React: 15.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions