1

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

kashif750
  • 31
  • 6

1 Answers1

0

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

pproe
  • 31
  • 2