I'm trying to add Sweetalert2 component in Angular to my project. When I put the npm install sweetalert2 in the terminal the following problem occurs:
Error: Cannot find module './internal/streams/stream'
and I don't know how to solve it.
This is the Error in the terminal:

CodePudding user response:
What worked for me was delete the package-lock.json and the node_modules folder then run
npm install
Then run :
npm install sweetalert2
or if you don't want to deal with this one put the url of the cdn in the html file you request like this :
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
CodePudding user response:
- Delete your
node_modulesby running:
rm -rf node_modules
- Delete your
package-lock.json - Clear your npm cache:
npm cache clean --force
- Run:
npm install
