Search code examples
reactjsnpmvisual-studio-2019react-bootstrappackage-lock.json

Adding bootrap-react from NPM creates another package-lock file in Visual Studio


I am new to react and trying to add react-bootstrap to my project.

I've got a Soultion with multiple projects in Visual Studio. As I've understand, I need to add a package for Bootstrap support.

Whenever I try to run:

npm install --save react-bootstrap

I am getting the following error in Package Manager Console: npm WARN saveError ENOENT: no such file or directory , open 'C:\Dev\xxx\Projectname\package.json'

Another package-lock.json files is being added to the root of the solution. Why does that happen? Shouldn't the dependency to react-bootstrap just populate the already existing package-lock.json inside the chosen project? What am I doing wrong? Is there another way to add it?


Solution

  • I managed to solve this by entering correct DIR before getting the package..

    CD:

    cd ./Project/ClientApp
    

    Install:

    npm install --save react-bootstrap