Home > Software design >  Error: Cannot find module './internal/streams/stream'
Error: Cannot find module './internal/streams/stream'

Time:01-10

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:

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:

  1. Delete your node_modules by running:
rm -rf node_modules
  1. Delete your package-lock.json
  2. Clear your npm cache:
npm cache clean --force
  1. Run:
npm install
  •  Tags:  
  • Related