title: Could not load credentials from any providers in NodeJS
body: <p>I am using AWSservices so I am using 'aws-sdk' package for nodeJS. As per their instructions on official website they ask to create a .aws folder in your current user profile and create credentials file there with secrete and access key in it.</p>
  
  <p>AWS doc link -</p>
  
  <p><a href="https://aws.amazon.com/developers/getting-started/nodejs/" rel="nofollow noreferrer">https://aws.amazon.com/developers/getting-started/nodejs/</a></p>
  
  <p>I follow the same procedure on windows and ubuntu. In windows AWS services are working fine but when I upload my code setup to AWS ubuntu  instance it start giving me following error.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
    "message": "Missing credentials in config",
    "retryable": false,
    "time": "2019-05-13T12:34:45.834Z",
    "code": "CredentialsError",
    "originalError": {
      "message": "Could not load credentials from any providers",
      "retryable": false,
      "time": "2019-05-13T12:34:45.834Z",
      "code": "CredentialsError"
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is code where I include 'aws-sdk' in JS file.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const AWS = require('aws-sdk');
  
  const {
    saveUserTokens,
    updateMigratedUser
  } = require('./databaseOperations');
  
  const AWS_REGION = "us-west-2";
  const CLIENT_ID = "5f70t79un9ep945645k5rooqocr4mfg";
  const USER_POOL_ID = "us-west-2_xxxxx";
  
  AWS.config.update({ region: AWS_REGION });
  const cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();</code></pre>
  </div>
  </div>
  </p>
  
  <p>console log of AWS.config object -</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Config {
    credentials:
     SharedIniFileCredentials {
       expired: false,
       expireTime: null,
       refreshCallbacks: [],
       accessKeyId: 'XXXXXXXXXXXXXXX',
       sessionToken: undefined,
       filename: undefined,
       profile: 'default',
       disableAssumeRole: true,
       preferStaticCredentials: false,
       tokenCodeFn: null,
       httpOptions: null },
    credentialProvider:
     CredentialProviderChain {
       providers:
        [ [Function],
          [Function],
          [Function],
          [Function],
          [Function],
          [Function] ],
       resolveCallbacks: [] },
    region: 'us-west-2',
    logger: null,
    apiVersions: {},
    apiVersion: null,
    endpoint: undefined,
    httpOptions: { timeout: 120000 },
    maxRetries: undefined,
    maxRedirects: 10,
    paramValidation: true,
    sslEnabled: true,
    s3ForcePathStyle: false,
    s3BucketEndpoint: false,
    s3DisableBodySigning: true,
    computeChecksums: true,
    convertResponseTypes: true,
    correctClockSkew: false,
    customUserAgent: null,
    dynamoDbCrc32: true,
    systemClockOffset: 0,
    signatureVersion: null,
    signatureCache: true,
    retryDelayOptions: {},
    useAccelerateEndpoint: false,
    clientSideMonitoring: false,
    endpointDiscoveryEnabled: false,
    endpointCacheSize: 1000,
    hostPrefixEnabled: true }</code></pre>
  </div>
  </div>
  </p>