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

Error: Cannot find module 'request' #50

Open
mica83 opened this issue Dec 10, 2020 · 7 comments
Open

Error: Cannot find module 'request' #50

mica83 opened this issue Dec 10, 2020 · 7 comments

Comments

@mica83
Copy link

mica83 commented Dec 10, 2020

Hi people, i'm testing this module but i have some problems.

I created a new empty node project with a new file "index.js" with this boilerplate code:

var itc = require('itunesconnectanalytics');
var Itunes = itc.Itunes;
var AnalyticsQuery = itc.AnalyticsQuery;

var username = 'UNAME';
var password = 'PASS';
var appId = '12345'; //Found in My Apps -> App -> Apple ID or read below on getting the app id.

var instance = new Itunes(username, password, {
  errorCallback: function(e) {
    console.log('Error logging in: ' + e);
  },
  successCallback: function(d) {
    console.log('Logged in');
  }
});

But when i run the command node index.js i get this error:

Error: Cannot find module 'request'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)

thanks

@peralmq
Copy link

peralmq commented Dec 10, 2020

As a workaround, you can do npm install request.

@mica83
Copy link
Author

mica83 commented Dec 11, 2020

As a workaround, you can do npm install request.

I tried, but also after this command the problem still.

Any suggestions?

@peralmq
Copy link

peralmq commented Dec 11, 2020 via email

@mica83
Copy link
Author

mica83 commented Dec 11, 2020

I don't know, it's strange. How did you create empty node project?
I did the following steps

  1. install module npm install itunesconnectanalytics
  2. create empty node project with the command npm init
  3. create a new file (index.js) in the project with the "usual boilerplate" code as indicated in project home
  4. install dependency npm install request
  5. run the code node index.js

But i have the errore indicated in the previous post

I got the same error message as you and got it working after a separate npm install of the request package. That's all I know unfortunately. Maybe we experienced different errors but got the same error message then?

On 11 Dec 2020, 10:47 +0100, Michele Cavalcanti @.***>, wrote: > As a workaround, you can do npm install request. I tried, but also after this command the problem still. Any suggestions? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

@peralmq
Copy link

peralmq commented Dec 11, 2020 via email

@mica83
Copy link
Author

mica83 commented Dec 11, 2020

Yeah! with point 1 and point 2 swapped it work! Thanks man

@peralmq
Copy link

peralmq commented Dec 11, 2020 via email

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

No branches or pull requests

2 participants