lightcrawler icon indicating copy to clipboard operation
lightcrawler copied to clipboard

lightcrawler: command not found

Open mgifford opened this issue 5 years ago • 5 comments

It seems to install fine, but.

$ npm install lightcrawler

  • [email protected] updated 1 package and audited 789 packages in 2.884s found 0 vulnerabilities

$ lightcrawler --url https://atom.io/ --config lightcrawler-config.json

-bash: lightcrawler: command not found

mgifford avatar Oct 30 '18 17:10 mgifford

you can add this:

"scripts": {
    "lightcrawler": "lightcrawler"
}

to your package.json file Then npm or yarn will look it up in node_module/.bin when you run yarn lightcrawler or npm run lightcrawler

alamowo avatar Nov 05 '18 09:11 alamowo

Can you add this all to a single install file?

Should be simpler to get to a point when you can run this.

Things like:

  1. Create a lightcrawler-config.json file

  2. Install the program - npm install --save-dev lightcrawler

  3. Run the program - npm run lightcrawler --url https://atom.io/ --config lightcrawler-config.json

Am I missing something here?

Do I need to create a directory and stick in a package.json file somewhere?

I'm not getting very far. Sorry.

mgifford avatar Nov 05 '18 20:11 mgifford

@mgifford when you install the package with npm install lightcrawler the package.json file is created in this folder for you

alamowo avatar Nov 05 '18 20:11 alamowo

@mgifford as a Drupal Buddy I can walk you through the process on a different channel (PM, Slack, E-Mail, you name it)

For this issue, I think it's not a problem of this package. The reason the lighthouse command is not found is that it's not in your $PATH. You can fix it like I wrote above:

you can add this:

"scripts": {
    "lightcrawler": "lightcrawler"
}

to your package.json file Then npm or yarn will look it up in node_module/.bin when you run yarn lightcrawler or npm run lightcrawler

Or you can install the package globaly with npm install lightcrawler -g as long as your global .node folder is in your '$PATH'.

alamowo avatar Nov 05 '18 21:11 alamowo

Hey thanks so @aharshbe really appreciate the Drupal community support. Ultimately I want to be able to run this along with automated testing on core. We haven't had a good means to do that, but think that lighthouse has some means to help us do a better job.

I had to nix my node/npm system entirely as I was getting stuck in too many spaces. Did an install on my Mac from https://nodejs.org/en/ npm = v6.4.1

Anyways, now I'm not able to install lightcrawler.

$ npm install lightcrawler

  • [email protected] updated 1 package and audited 2987 packages in 3.853s found 2 vulnerabilities (1 low, 1 critical) run npm audit fix to fix them, or npm audit for details

$ npm audit fix up to date in 2.697s fixed 0 of 2 vulnerabilities in 2987 scanned packages 2 vulnerabilities required manual review and could not be updated

Although I did find a lightcrawler-config.json file where I tried to install it previously. I hadn't realized it would drop a json file there.

There's definitely stuff I'm not getting about node.js. Do I need to run npm init to create a package.json file? Seems that most of the instructions (of the several projects I've investigated) make some pretty big assumptions about the knowledge base. Adding the -g works mind you: $ npm install lightcrawler -g

Anyways, hmm.. In a new directory, when I drop in the example from the install into a lightcrawler-config.json file then run:

$ lightcrawler -u https://openconcept.ca -c lightcrawler-config.json

It seems to be working..

I'll reach out in the Drupal world and find you there. This might be worked through though. Thanks!

mgifford avatar Nov 06 '18 01:11 mgifford