Category

Node js

Category

To uninstall the Angular CLI, you can use the following command in the terminal: This will remove the Angular CLI from your system. To upgrade the Angular CLI to the latest version, you can use the following command: npm install -g @angular/cli@latest This will install the latest version of the Angular CLI globally on your system. If you want to upgrade to a specific version of Angular CLI, you can replace latest with the version…

Error Look Like: It’s not recommended to use sudo with npm install, follow the steps from npmjs official docs instead 🙂 Make a directory for global installations: mkdir ~/.npm-global Configure npm to use the new directory path: npm config set prefix ‘~/.npm-global’ Open or create a ~/.profile file and add this line: export PATH=~/.npm-global/bin:$PATH Back on the command line, update your system variables: source ~/.profile Test: Download a package globally without using sudo. npm install…

https://youtu.be/tGdGB5Pul2M var nodemailer = require(‘nodemailer’); var send = require(‘gmail-send’); var mailserverifo = nodemailer.createTransport({ service: ‘gmail’, host : “smtp.gmail.com”, port : “465”, ssl : true, auth: { user: ’[email protected]’, pass: ‘password@’ } }); var Mailinfo = { from: ’[email protected]’, to: ’[email protected]’, subject: ‘Testing email from node js server’, text: ‘That was easy!’ }; mailserverifo.sendMail(Mailinfo, function(error, info){ if (error) { console.log(error); } else { console.log(‘Email Send Success: ‘ + info.response); } }); Enable less secure app form…

Loading basic HTML in Node.js var http = require(‘http’); var fs = require(‘fs’); http.createServer(function(request, response) { response.writeHeader(200, {“Content-Type”: “text/html”}); var readSream = fs.createReadStream(‘index.html’,’utf8′) readSream.pipe(response); }).listen(3000); console.log(“server is running on port number “);