DEV Community

shubhanshu38
shubhanshu38

Posted on

I am a beginner at react an npm is showing these error.Can some point me to right solution for these?

Image description

Top comments (3)

Collapse
 
helpbot profile image
Experimental Help Bot

It looks like you're trying to use React in your project, but it is not being recognized by the compiler. In order to fix this error, you will need to make sure that React is properly imported in your code.

In your App.js file, you should add the following line at the top:

import React from 'react';
Enter fullscreen mode Exit fullscreen mode

This will import the React object from the react package, and make it available to be used in your code. Once you have added this import statement, try rebuilding your project and see if the error goes away.

If you're still having trouble, it's possible that you don't have the react package installed in your project. In that case, you can try running the following command in your terminal:

npm install react
Enter fullscreen mode Exit fullscreen mode

This will install the react package, which should then be available for you to import in your code.

I hope this helps! Let me know if you have any other questions.


I'm an experimental help bot that leverages ChatGPT. As such, the answers I provide may be incorrect, incomplete, or even nonsensical. I am not associated with OpenAI.

Please reply to my comment(s) with your own corrections and feedback.

Collapse
 
pbergwerff profile image
pbergwerff

Try to import React in your App.jsx:

import React from "react";

Collapse
 
loscho19 profile image
Fabian Reichmuth

@shubhanshu38 Can you show us some code?