kashif750
kashif750

Reputation: 29

Module Not Found - I have created a Basic React NPM package but getting an Error "Module Not Found"

I have created a basic react npm package using the command npx create-react-app following the geeksforgeeks-create-react-npm-package documentation but after publishing it, getting an error

npm repo link: k-k-react-header-package

import "./App.css";
import Header from "k-k-react-header-package";
function App() {
    return (
        <>
            <h1>React Practice Remove it!</h1>
            <Header />
        </>
    );
}

export default App;

Error

Module not found: Error: Can't resolve 'k-k-react-header-package' in 'G:\it22\personal\react-practice-remove-it\src'
ERROR in ./src/App.js 5:0-46
Module not found: Error: Can't resolve 'k-k-react-header-package' in 'G:\it22\personal\react-practice-remove-it\src'

webpack compiled with 1 error

**I don't how to resolve it."" Anyone have any Idea

Upvotes: 1

Views: 28

Answers (1)

pproe
pproe

Reputation: 46

Looks like you haven't installed your package properly. Make sure you run npm install kk-react-header-package before running the app.

Upvotes: 0

Related Questions