1

I'm trying to use this node module: aws-api-gateway-client

Installation is successful but I cannot use this module because of importing module error.

I don't understand why it works in any projects without angular2 and typescript (I'm using angular-cli tool for my starter project).

import apigClientFactory from 'aws-api-gateway-client'

I also tried with:

import * as apigClientFactory from 'aws-api-gateway-client'

but It doesn't work, this is the error showed in console:

Cannot find module 'aws-api-gateway-client'.

Can anyone help me with this problem?

8
  • Did you define it inside your system.config? Commented Jan 5, 2017 at 5:06
  • Question is not very clear. Are you facing problem installing the lib? Have you installed the lib using npm install <<lib>>? Commented Jan 5, 2017 at 5:12
  • @echonax Can you tell me how to define it in system.config? Commented Jan 5, 2017 at 5:16
  • @Divs Installation is successful but I couldn't use it in my project because of error I mentioned in the post. Commented Jan 5, 2017 at 5:16
  • @NguyenThanh can you provide it in your question? Commented Jan 5, 2017 at 5:16

2 Answers 2

2

Use it as below code

var apigClientFactory = require('aws-api-gateway-client');
Sign up to request clarification or add additional context in comments.

4 Comments

Module not found: Error: Can't resolve 'aws-api-gateway-client'
It worked for me i am using webpack. Did u successfully installed aws-api-gateway-client?
Yes, It's working fine with webpack but I don't know why it doesn't work with an angular2+typescript project.
I don't know why your solution suddenly working after many hours I tried googling.
1

after installing this package through npm,make sure you grab specific module from system.config.js for further use as follow,

map: {

    'app': './src',
    ....
    ....

    'aws-api-gateway-client': 'node_modules(or npm)/folder Name Which Contains apigClient.js file/apigClient.js ',
    //<---I don't know exact path as I don't use apigCliet in my project 
    //<---but open your node_modules folder and check for apigClient.js path. 

  },

Then,

 import apigClientFactory from 'aws-api-gateway-client'

2 Comments

Cannot find system.config.js in angular4
@Yasar Arafath it is there. You can check it in src/app folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.