Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are all these babel plugins required? #41

Open
prodigitalson opened this issue Sep 27, 2018 · 3 comments
Open

Are all these babel plugins required? #41

prodigitalson opened this issue Sep 27, 2018 · 3 comments
Assignees
Labels

Comments

@prodigitalson
Copy link

prodigitalson commented Sep 27, 2018

Getting error below if I attempt to run the code from examples/get_title.js in my own file:

module.js:549
    throw err;
    ^

Error: Cannot find module 'babel-runtime/helpers/typeof'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/username/crawler-test/node_modules/queue-promise/dist/index.js:7:16)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

I do not have any of the babel modules queue-promise is trying to install, and none of those are listed as dependencies (aside from dev-dependencies) in either crawlerr or queue-promise package.json. Am I doing something wrong, or was this a build issue you didn't catch?

My test file run with node ./index.js:

"use strict";

const crawler = require("crawlerr");
const spider = crawler("http://google.com/");

spider
  .get("/")
  .then(({ req, res, uri }) => {
    console.log(`Title from ${uri}:`, res.document.title);
  })
  .catch(error => {
    console.log(error);
  });
@Bartozzz Bartozzz added the bug label Sep 27, 2018
@Bartozzz Bartozzz self-assigned this Sep 27, 2018
@Bartozzz
Copy link
Owner

I'll have a look at this, probably a build issue. Normally, it should work without any additional Babel packages. Can you tell me which Node version are you using?

@prodigitalson
Copy link
Author

Thanks!

Node 8.11.3
NPM 5.6.0

@Bartozzz
Copy link
Owner

Bartozzz commented Sep 27, 2018

I've just published v1.5.0 on npm. You can install it by running the following command in your CLI:

$ npm install [email protected]

It should work perfectly on Node.js LTS (8.12). I guess it will work just fine on Node 8.11.3 but I encourage you to upgrade your Node version to a long-term supported version. Please, let me know if the error persists.

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

No branches or pull requests

2 participants