Ionic2 and AWS Integration - amazon-web-services

Does anyone have any examples or could possibly point me in the right direction on how to integrate aws-sdk within Ionic 2?
I tried running the code below:
npm install aws-sdk --save
typings install dt~aws-sdk --save --global
But now when I try to build or run the app I get:
TypeScript error: typings/globals/aws-sdk/index.d.ts(1575,24): Error TS2304: Cannot find name 'Buffer'.
I'm fairly new to Ionic2 so how would I go about importing this sdk to use?
Thanks in advance
SDK Link: https://www.npmjs.com/package/aws-sdk
Ionic 2: http://ionicframework.com/docs/v2/

To anyone else stuck trying to integrate AWS into ionic2 then please follow this link.
https://github.com/awslabs/aws-cognito-angular2-quickstart/issues/8
Vladimir Budilov at AWS was kind enough to share his repository.

None of the above solutions worked for me, For my case the following worked:
In your angular or ionic project run:
npm install aws-sdk --save
Before you can begin using these TypeScript definitions with your project, you need to make sure your project meets a few of these requirements:
npm install --save-dev #types/node

Related

Expo won't build with locally installed NPM packages

I am using expo#43.0.3 (and expo-cli#5.0.3) to manage my react native project and I have to install an npm package from local source:
$ npm install /path/to/mypackage
In my package.json the package is successfully linked via
"dependencies": {
...
"myPackage": "file:../../mypackage",
...
}
I can also confirm the package works when installing to a new plain node project (same node version 14.8.2)
Now when I start expo via expo start and navigate to the app it does not throw any error but only a warning:
› Reloading apps
warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB.
When using the package from registry everything builds, however.
I tried to use the private packages section form the expo docs, but they only describe how to use private packages from registry but not local.
Anything I'm missing here?
edit:
After resetting the expo network adapters it loads the bundle but it now says it can't find the package:
Unable to resolve module myPackage from /home/user/path/to/myPackage/file.js: myPackage could not be found within the project or in these directories:
node_modules
If you are sure the module exists, try these steps:
1. Clear watchman watches: watchman watch-del-all
2. Delete node_modules and run yarn install
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
However, I'm not using watchman and I'm not using yarn and rmoving metro- folders from /tmp did not make a difference.
As it turned out in this issue on GitHub it can be solved via npm pack:
run npm pack inside of your library and then npm install path/to/the/packed/file.tgz from your project
Which worked fine for the setup I described in the question.

Why should I use ember install over NPM or yarn?

I'm new to ember and I discover the command ember install pkg and I'm wondering why such package instead of using external package manager such as yarn or npm which are industry-wide/de-facto standard.
Question
Why should I use ember install over NPM or yarn?
ember install addon-name is a short hand for npm install --save-dev addon-name && ember g addon-name
The documentation provides the answer for this one (ctrl + f ember install):
Installs the given addon into your project and saves it to the
package.json file. If provided, the command will run the addon’s
default blueprint.
The release notes for version 0.1.5 provide a clue for this as well:
#2805 Added the install:addon command, which installs an addon with NPM and then runs the included generator of the same name if it
provides one.
So, ember install is just a replacement for npm in most cases but when a blueprint is provided it will run those as well.

Installing npm for bower on dokku

I am trying to use bower install on my Django app, which is running on a dokku image.
I've got a plugin which tries to run it on pre-deploy but it needs npm and there's no npm installed on the image.
Does anyone know how to get npm on to the image or am I going about things the wrong way here?
In case anyone stumbles over this problem themselves, the answer is to use this plugin:
https://github.com/F4-Group/dokku-apt

How to replace the handlebars with htmlbars in Ember CLI app?

I am facing the following issue after upgrading the Ember and Ember data to the canary versions.
Cannot set property 'compilerInfo' of undefined
I found the discussion about the issue in Ember CLI repo.
https://github.com/ember-cli/ember-cli/issues/2955
The solution is to replace handlebars with htmlbars. But I don't know the exact steps to do that.
I checked handlebars repo. It gives code snippets but I don't know where to place the code exactly.
Any idea?
You will still be using Handlebars, but you need 2.0.
For HTMLBars, what you'll change is the template compiler.
npm uninstall --save-dev broccoli-ember-hbs-template-compiler
npm install --save-dev ember-cli-htmlbars
rm -rf bower_components
bower install --save handlebars#2.0.0
bower install

Foundation 5 Sass Creates Empty Project Folder

I'm following the guide over here to install Foundation with Sass. I've got Git, Ruby and Node.js installed. I also believe Bower is installed correctly because when I type bower help into the command line I get information on its command.
When I try to install Foundation with gem install foundation I get this error:
Fetching: foundation-1.0.4.gem (100%)
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/local/rvm/gems/ruby-1.9.3-p194/gems/foundation-1.0.4/.gitignore
If I then try adding sudo to the beginning of that command it seems to install just fine. Is this the correct way to do this?
Then when I enter foundation new test-project it creates that directory and seems to create those files, but when I go into the "test-project" folder it's empty.
Does anyone have an idea of what I'm doing wrong? Any help would be appreciated.
Thanks in advance!
Ok, so it seems like it with a problem with my git install. I uninstalled git and installed the latest version, and that seemed to do the trick. That folder is now populated with the Foundation files and I can get to work!