mongodb stitch browser sdk AwsServiceClient undefined - mongodb-atlas

Why is AwsServiceClient undefined?
npm install mongodb-stitch-browser-sdk (4.7.1)
npm install mongodb-stitch-browser-services-aws-s3 (4.7.1)
import { Stitch, AwsServiceClient, AwsRequest } from "mongodb-stitch-browser-sdk";
I am trying to upload a photo via stitch to S3.

You are supposed to install the mongodb-stitch-browser-services-aws sdk to be able to use the AwsServiceClient:
npm install mongodb-stitch-browser-services-aws
import { AwsServiceClient } from 'mongodb-stitch-browser-services-aws';

Related

Using a Cordova plugin with Capacitor

I've been working through this example:
https://capacitor.ionicframework.com/docs/basics/cordova
I've run:
npm install cordova-plugin-qrscanner
npx cap sync
and I can see the plugin installed in my node_modules.
What I do not know how to do is call one of the functions on the cordova-plugin. I'm wondering if I need a packager like webpack?
I'm also confused as to how this works if the cordova plugin contains native swift (or other) code.
Remember you can install the native wrapper too. It should work just the same as using it with Cordova.
npm install #ionic-native/qr-scanner
From:
ionic cordova plugin add cordova-plugin-qrscanner
npm install #ionic-native/qr-scanner
To:
npm install cordova-plugin-qrscanner
npm install #ionic-native/qr-scanner
npx cap sync
https://ionicframework.com/docs/native/qr-scanner

Install specific branch from github using Npm

I would like to install bootstrap-loader from github in my project using npm
Currently they are maintaining two version of this project which are comaptible with webpack version 1 and 2.
I would like to install version 1. What npm command I should use to install this?
I tried using below one but it is not working.
npm install git://github.com/shakacode/bootstrap-loader.git[#v1] --Save
There are extra square brackets in the command you tried.
To install the latest version from the brach-name branch, you can use:
npm install "https://github.com/shakacode/bootstrap-loader.git#branch-name" --save
npm: npm install username/repo#branchName --save
yarn: yarn add username/repo#branchName
e.g. npm i betimer/rtc-attach#master --save (my username is betimer)
// this will appear in your package.json:
"rtc-attach": "github:betimer/rtc-attach#master"
One thing I also want to mention: it's not a good idea to check in the package.json for the build server auto pull the change. Instead, put the npm i (first command) into the build command, and let server just install and replace the package.
One more note, if the package.json private is set to true, may impact sometimes.
you can give git pattern as version, yarn and npm are clever enough to resolve from a git repo.
yarn add any-package#user-name/repo-name#branch-name
or for npm
npm install --save any-package#user-name/repo-name#branch-name
Another approach would be to add the following line to package.json dependencies:
"package-name": "user/repo#branch"
For example:
"dependencies": {
... other dependencies ...
"react-native": "facebook/react-native#master"
}
And then do npm install or yarn install
I'm using SSH to authenticate my GitHub account and have a couple dependencies in my project installed as follows:
"dependencies": {
"<dependency name>": "git+ssh://git#github.com/<github username>/<repository name>.git#<release version | branch>"
}
Had to put the url in quotes for it work
npm install "https://github.com/shakacode/bootstrap-loader.git#v1" --save
Tried suggested answers, but got it working only with this prefix approach:
npm i github:user/repo.git#version --save -D
Only solution working for me:
$ npm i https://github.com/{USER}/{REPO}/tarball/{BRANCH} --save
as explained here.
Both below versions work for me as of beginning of 2023:
npm i "github:shakacode#bootstrap-loader"
npm i "https://github.com/shakacode/tree/bootstrap-loader/"
The Doc of the npm defines that only tag/version can be specified after repo_url.
Here is the Doc: https://docs.npmjs.com/cli/install

-bash: firebase: command not found

I need to host website to google firebase hosting.
I looked almost everywhere but steel have the problem.
I have installed npm install --global firebase also npm install -g firebase-tools but when I want to use firebase command it says : "command not found"
firebase-tools "-bash: firebase: command not found"
Firebase Hosting set up issue
https://github.com/firebase/firebase-tools/issues/46
this posts didn't helped
this is after sudo npm install --global firebase-tools
alias firebase="`npm config get prefix`/bin/firebase"
I forgot to install Firebase Tools after a long time away from it on new computer... Use npm i firebase --save to set your project up and npm install -g firebase-tools to install the tools for e.g. serving your app locally, etc.
In macOS:
You can use this query
curl -sL https://firebase.tools | bash

How to verify facebook jest is installed successfully

I followed the instructions to install Facebook jest on https://facebook.github.io/jest/docs/getting-started.html#content :
npm install --save-dev jest-cli
After the install command I typed jest in the terminal, and press enter but It popped:
bash: jest: command not found.
But when I run the getting started sample by using npm test in the terminal, it worked well.
So, how can I verify that Facebook jest is installed successfully?
Ways to install a package in npm
In node.js you have two ways to install a package: globally or locally.
The sintax is the following:
// globally
npm install -g [package_name]
// locally
npm install --save-dev [package_name]
So, now what it happens is that you run the local one which downloads the package in node_modules under your project folder.
To check you installed jest properly so you can check on your node_modules if there is a jest folder.
How to check if jest is installed
In addition to that npm is creating a shortcut in you local node_modules under the directory .bin son in there you should find a link to jest.
You can test that like that:
cd your_project_folder
./node_modules/.bin/jest
Why npm test works?
The reason why npm test works is because when you run it npm is going to look for the commands globally and locally.

Install ionic framework.

I have installed the module with node version v0.10.22
sudo npm install -g ionic
But know when I am trying to start an new application I am getting a
-bash command not found
which ionic
gives me nothing, do I have to add the path to on the $PATH variable ?
How did you installed npm? If you used homebrew then npm won't put npm files accessible by users.
Add export PATH=/usr/local/share/npm/bin:$PATH to your .bashrc/.bash_profile/.zshrc file and it should work fine.
Also refer this: Bower: "command not found" after installation