Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

lightcrawler: command not found #15

Open
mgifford opened this issue Oct 30, 2018 · 5 comments
Open

lightcrawler: command not found #15

mgifford opened this issue Oct 30, 2018 · 5 comments

Comments

@mgifford
Copy link

It seems to install fine, but.

$ npm install lightcrawler

  • lightcrawler@0.0.9
    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

@alamowo
Copy link

alamowo commented Nov 5, 2018

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

@mgifford
Copy link
Author

mgifford commented Nov 5, 2018

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.

@alamowo
Copy link

alamowo commented Nov 5, 2018

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

@alamowo
Copy link

alamowo commented Nov 5, 2018

@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'.

@mgifford
Copy link
Author

mgifford commented Nov 6, 2018

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

  • lightcrawler@0.0.9
    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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants