I installed bootstrap
using npm i -g bootstrap
and trying to include bootstrap
in a React-app as import "bootstrap/dist/css/bootstrap.css";
.
However, it is throwing an error.
Failed to compile.
./src/index.js
Module not found: Can't resolve 'bootstrap/dist/css/bootstrap.css' in '/home/username/nodeProjects/react-app/src'
But when I actually install it locally as npm i bootstrap
and import it as import "bootstrap/dist/css/bootstrap.css";
, it is working as expected.
Is there any different approach to import npm
packages when they are installed globally and locally or am I doing something wrong?