Posts

Showing posts with the label npm

npm audit vulnerability reports a path I cant find

npm audit vulnerability reports a path I cant find Im trying to resolve the issues that npm audit found. After running npm audit fix, I still have some that require "manual intervention". One of which is below. After doing a bit of research, im not the only one having these kind of issues, is Angular 6.x still a bit too new for production apps? Im running npm 6.1.0 and Angular 6.0.6 The path the message reports suggests the files are within the karma package, but I dont see anything for long4js within node_moduleskarma. Where is this referencing? Moderate Prototype pollution Package hoek Patched in > 4.2.0 < 5.0.0 || >= 5.0.3 Dependency of karma [dev] Path karma > log4js > loggly > request > hawk > hoek More info https://nodesecurity.io/advisories/566 "is Angular 6.x still a bit too new for production apps?" <-- that bit is not a very good SO question and mu...

Add image in header using html-pdf node module

Image
Add image in header using html-pdf node module I am using this to convert the html to PDF.The conversions are really good.But the problem is to add header and footer in the PDF pages.In the options if i add the header text i got the result what i expected. //Options var options = { "header": { "height": "45mm", "contents": " Author: Marc Bachmann " // If i add image in content it wont work // sample i tried }, "footer": { "height": "28mm", "contents": "<span style='color: #444;'>{{page}}</span>/<span>{{pages}}</span>" } } // Tried this in contents <img src="image path" /> var result = HTML CONTENT '; pdf.create(result, options).toFile(fileName + ".pdf", function(err, res) { if (err) { console.error(err); callback(); }...

What is the JavaScript equivalent of python's .text?

Image
What is the JavaScript equivalent of python's .text? Element.text returns the text content of an element. In a different thread on SO, the python script scrapes data from the followers modal on an Instagram account. The following part returns the text inside the lists and stores them in an array. xpath = "//div[@style='position: relative; z-index: 1;']//ul/li/div/div/div/div/a" followers_elems = driver.find_elements_by_xpath(xpath) return [e.text for e in followers_elems] I'm trying to achieve a similar result in JavaScript (I'm using WebDriverJS) : const XPATH = "/html/body/div[3]/div/div[2]/div/div[2]/ul/div/li"; var followers_elems = await driver.findElements(By.xpath(XPATH)); var followers_temp = ; for (var e in followers_elems) { followers_temp.push(e.textContent); } console.log(followers_temp); I'm not sure if textContent is the right property for .text . I've tried a million different alternatives but all I'm getting...

Asp.net Angular Template application Npm update does not work

Asp.net Angular Template application Npm update does not work I am trying to follow the documentation found here however it is going well. All of the packages that gets created with the application are out of date such as the @angular/compiler which really the version at the time of this post is 6.0.2 not 4.2.5 as listed below in the generated packages.json . @angular/compiler 6.0.2 4.2.5 packages.json Things to note. With the packages being this out of date there are many angular things I can take advantage of. I have been looking around however I have not found any solutions that work. Things I have tried: My dependencies: { "name": "TestingApp", "private": true, "version": "0.0.0", "scripts": { "test": "karma start ClientApp/test/karma.conf.js" }, "devDependencies": { "@angular/animations": "4.2.5", "@angular/common": "4.2.5", ...

Install node_modules inside Docker container and synchronize them with host

Install node_modules inside Docker container and synchronize them with host I have the problem with installing node_modules inside the Docker container and synchronize them with the host. My Docker's version is 18.03.1-ce, build 9ee9f40 and Docker Compose's version is 1.21.2, build a133471 . node_modules 18.03.1-ce, build 9ee9f40 1.21.2, build a133471 My docker-compsose.yml looks like: docker-compsose.yml # Frontend Container. frontend: build: ./app/frontend volumes: - ./app/frontend:/usr/src/app - frontend-node-modules:/usr/src/app/node_modules ports: - 3000:3000 environment: NODE_ENV: ${ENV} command: npm start # Define all the external volumes. volumes: frontend-node-modules: ~ My Dockerfile : Dockerfile # Set the base image. FROM node:10 # Create and define the working directory. RUN mkdir /usr/src/app WORKDIR /usr/src/app # Install the application's dependencies. COPY package.json ./ COPY package-lock.json ./ RUN npm install The trick with...

Internet disconnects when I start a local server using node

Internet disconnects when I start a local server using node I am learning web development and for some recent projects I have to use react. I have initialized the project using create-react-app project-name but when I run yarn start , my internet suddenly stops working. I am connected to an open network with cyberoam login client. I am on Ubuntu 18.04 development environment and my npm version is 3.5.2 and node version is 8.10.0 I have to restart my computer to get the internet working again. I have tried to restart network-manager but that didn't help. If I don't spawn up a dev server, the internet works fine but the moment I start the server, the internet stops working. create-react-app project-name yarn start 3.5.2 8.10.0 By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is ...

error collapse bootstrap in vuejs and laravel

error collapse bootstrap in vuejs and laravel I have a problem when use bootstap. I have master.blade.php contain all source javascript ( including jquery ) I use npm to build vuejs. In my component contain collapse of bootstrap: <a :href="'#'+item.id" class="list-context" :id="'list-parent-'+item.id" data-toggle="collapse" :data-target="'#list-sub-'+item.id"> {{ item.value }} </a> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. When i click a tag , it add show class. But i re-click, it change class ,as follows :(remove show class-> add collapsing ->remove collapsing -> app collapse show) It looks like two jquery file collide, one file inside master.blade.php, one file include in resources/assets/bootstrap.js. When i remove script tag in master.blade.php then it work fine Someone can tell me some suggest for thi...

Installing Bootstrap with NPM

Installing Bootstrap with NPM I know how to use npm to install and maintain build tools, but I realize I'm not sure how to leverage it to install frameworks (css or js I'd normally just slap the script/css links in my index.html). But, let's say I want to use npm. I'd run an npm install bootstrap and npm install jquery , but then I'm not sure what the next step is. npm install bootstrap npm install jquery I could then just say <link rel="stylesheet" type="text/css" href="nodemodules/boostrap/dist/css/bootstrap.css"> but that seems clunky and dumb. <link rel="stylesheet" type="text/css" href="nodemodules/boostrap/dist/css/bootstrap.css"> I see a lot of people importing stuff like this with require('bootstrap'); but honestly I'm not even sure where to put that. require('bootstrap'); Could somebody help me fill in these blanks? You could use a grun...

Node server and npm is not running on Windows 12 EC2 instance in AWS

Node server and npm is not running on Windows 12 EC2 instance in AWS I am running following command in User Data but I don't see that npm is installing npm_module and also not running node server.I have verified that node is already installed and PATH is already set.My Node code and pacakge.json is under 'MyNodeServer' folder. $ctiServerDir="D:AppsCTICloudMyNodeServer" mkdir $ctiServerDir npm set proxy= myproxy npm set https-proxy=myhttpsprxy Set-Location $ctiServerDir npm install npm start What version of nodejs you are using? What is npm version? What error you see when you run node application? – Pramod Jangam 2 days ago npm version 3.10.10 and node v6.11.3 – user3462602 2 days ago ...