Unable to add filesystem permission denied - google-chrome-devtools

Using node v 8.9.0 and this tutorial
When I try and debug my http google cloud function in dev tools:
C:_Users_Matt_AppData_Roaming_nvm_v8.9.0_node_modules_#google-cloud_functions-emulator_src_supervis
I get filesystem permission denied error, how can I debug my cloud functions:

I also got the filesystem permission denied error, and the issue was that you need to accept the premissions from chrome to be able to access that filesystem. initially I didn't see the premissions prompt, but then I found it on a different tab (which was kinda weird behavior). I guess just look for that permissions prompt, it should be right below your address bar.

I see that you are referring to a C directory, which means that you are trying this on Windows OS. I will put the steps below with documentation links on how to properly setup the configuration. Those steps worked for me well without giving me any issues, so I suggest you to follow them one by one and see if that helps you.
Run Google Cloud Functions Emulator on Windows OS:
Install and set up Google Cloud SDK for Windows. Link and documentation here
Install Node.js and npm for Windows. Tutorial here
Right click on Google Cloud SDK Shell and select Run as administrator.
Execute $ node --version you should get the version of Node.js without any additional errors
Execute $ npm --version you should get the version of npm without any additional errors
The tutorial that you are referring to is part of Google Cloud Functions Tutorial Series
First install and set up npm functions emulator by running $ npm install -g #google-cloud/functions-emulator as mentioned in Google Cloud Functions Tutorial : Setting up a Local Development Environment
Setup the project for the functions $ functions config set projectId PROJECT_ID as mentioned in Start and Stop the Emulator documentation.
Start the emulator by executing $ functions start. Same documentation as above.
Download the source code as mentioned in the documentation you are referring to. The GitHub repository is here.
Clone the project locally. $ git clone https://github.com/rominirani/googlecloudfunctions-training.git
Navigate to the folder $ cd googlecloudfunctions-training/helloworld-http
Follow the rest of the Google Cloud Functions Tutorial : Debugging Local Functions documentation.
NOTE: Whenever you run / execute / call the Cloud Function the Node.js
blank window will pop up. Keep it open as it is the executable that
executes your code.
I have tested the tutorial with the above set up that I described and it worked for me. You have to be the administrator of your account, since the Functions Emulator and the code is running locally, so you have to have all the permissions of the directories that are going to be used and execute all the software as administrator.

Related

flutterfire configure not working even after installing via npm, and relogging

I keep getting this error no matter what I attempt to do,
I've already tried using "npm install -g firebase-tools",
and "firebase projects:list" displays a correct list of my current projects.
Looking for help as I have sunk countless hours into this problem without being able to move a step forward.
FirebaseCommandException: An error occured on the
Firebase CLI when attempting to run a command.
COMMAND: firebase --version
ERROR: The FlutterFire CLI currently requires the official Firebase CLI to also be installed, see https://firebase.google.com/docs/cli#install_the_firebase_cli for how to install it. ```
In case you have installed (and renamed) firebase.exe from the windows installer, remove that first.
The installation of npm install -g firebase-tools and the windows installer are conflicting with each other.
Then go through firebase logout and firebase login again before running flutterfire configure.
I added the firebase-tools file downloaded from https://firebase.tools/bin/win/instant/latest in the root of the directory of my project and it works for me. I changed the name to firebase only.

Cloud Shell , I should install CBT each time i open cloud shell the day after

To use any GCloud componet, I have installed on Cloud Shell just once, and i could use it each time i open cloud shell. But for CBT component for BigTable, I don't know what is happening that each time I close the browser the CBT tool is not installed any more and I should re-install it. The problem does not appear immediately, generally each day I should install it and it exist between installed components for whole day, and the day after I see it is not any more installed!
Any idea ?
This problem is caused by Google terminating idle Cloud Shell instances when they are not being used. Termination happens after about 60 minutes of non-use.
Only data stored in the $HOME directory persists after a new Cloud Shell is launched.
To install cbt the following steps are recommended:
gcloud components update
gcloud components install cbt
Since these components are not being installed in $HOME, they do not persist after Cloud Shell is terminated.
There are two methods that I recommend to solve this problem:
Google Cloud Shell is a Docker container. You can modify the docker image to customize to fit your needs. This method will allow you to install packages, tools, etc that are not located in your $HOME directory.
Modify .bashrc to run a script located in the $HOME directory to install cbt each time a new instance is created.
Note: It appears as of now that cbt is included in the default Cloud Shell instance. This answer should help others understand what is happening and be able to install other programs, tools, etc. persistently.

Google Cloud SQL Proxy for Windows

Does anyone know from where I can download a Windows version of the Cloud SQL Proxy?
I see on the support page an example command line, but there's no indication of where you could get a binary from. It's not on the Github.
Thanks
There is now a pre-compiled proxy version released, see the doc page for the download link: https://cloud.google.com/sql/docs/sql-proxy .
Note that you must run the program in a command prompt; there's a feature request to allow a web-UI configuration rather than doing a command prompt.
If you want to compile to code yourself from source it is relatively straightforward:
Install Go (use the .msi installer)
Execute the following in a command prompt (requires installation of git):
go get github.com/GoogleCloudPlatform/cloudsql-proxy/cmd/cloud_sql_proxy
The proxy binary should be located in %GOPATH%\bin (you should be able to do cd %GOPATH%\bin in a command prompt and then use dir to see the cloud_sql_proxy.exe file).
It's been a while since I've used windows for development, so let me know if there are any troubles.

Deploying meteor app to a webserver

Does anyone know a step by step guide to deploy the own meteor app from windows to a webspace (not xxx.meteor.com).
I've found some tools like meteor.sh, but I'm a beginner and it's difficult without a guidance and without linux (needed to execute sh-files for example)
Make your project locally
Build your project locally, you could test it using meteor run or even meteor deploy xxx.meteor.com to see if its working
Bundle your app
Use meteor bundle deploy.tar.gz to make a file called deploy.tar.gz in your meteor directory containing your project
Upload your file to your server
This depends more on how your server is/what your platform is but you can use a tool to upload it for you (e.g Transmit on mac)
Install node.js & fibers on your platform if you don't have it already
This depends alot on your server platform. Have a look at http://nodejs.org/ for more detailed instructions
Extract your bundle
If on a *nix platform you could do the below in the directory where you uploaded your bundle (explanation):
tar -xzvf bundle.tar.gz
Enter the directory and install fibers
Fibers is needed for any meteor project, it helps use synchronous style code on server side javascript:
cd bundle/programs/server/node_modules
rm -r fibers
npm install fibers#1.0.1
The first line enters the directory in your bundle where fibers is installed, the second removes it, and the third reinstalls it.
Get MongoDB on another server or use a third party service like mongohq
Meteor production deployments need another mongodb. You can either install it on another server or use a third party server. It's not recommended to install it on the same server you install meteor on.
Finally check if your project is runnable
cd ../../../
node MONGO_URL=mongodb://dbuser:dbpassword#dbhost:dbport/meteor ROOT_URL=http://yourwebsite.com app.js
The first line gets you back to the bundle directory and the second runs node.js on your project with the parameters that let you connect to your mongodb database.
Install something to let it run in the background
It depends on which one you want to use, foreverjs is quite easy to use
npm install forever -g
If you get an error problem try using sudo before the npm (which lets you run as a super user).
Then you can run forever:
forever start MONGO_URL=mongodb://dbuser:dbpassword#dbhost:dbport/meteor ROOT_URL=http://yourwebsite.com app.js
And its done!
Extra notes
While its not that easy to get started from scratch this should help you get started. You still need to secure your mongodb server up if you've used your own servers.
The meteor.sh script does pretty much the same as above but very quickly if you learn to use that instead it might be faster to deploy updates
You might not have wget or a couple of commands that you might need that come up and give you Unknown command errors. Have a go at running yum or apt-get and see which one of the two you might have. You can then install the required package using one of these installer tools, i.e with yum install wget
I hope this helps you, its not that easy to deploy to a server on the first shot as a couple of things might be missing (files/packages/dependencies), you might run into other problems with permissions & stuff, but you could always ask on serverfault or here on stackoverflow on what you run into.
I recommend Meteoric.
Note, that you need to run meteoric from your development machine.
Script is self explanatory and works perfect for me.

plugman not working on windows? adding core features to phonegap 3.0 app

I have followed theese instructions.
installed plugman (command didnt work, so I added this C:\Users\XXX\AppData\Roaming\npm\node_modules\cordova\node_modules.bin to PATH to make 'plugman' command work in cmd).
after getting plugman command to work (it's help was working in console), Ive entered the camera api command:
plugman --platform android --project c:/path/to/app --plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
the output was:
undefined is not a function
what did I do wrong?
I've found an answer on phonegap google group.
To make this work, you need to install git console and then download the plugin with command:
phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
The is a bug that was recently submitted and fixed.
You basically need Git installed, yes, but for plugman to work in "cmd.exe" (or any non-Git CLI) you need to have Git/bin in your system path.
Taken from my blog (http://atomicstructure.net/blog/2013/07/phonegap-3-0-troubles):
Click Start, right-click Computer then select Properties. Click Advanced System Settings (top-left) then Environment Variables in the Advanced tab.
Under System variables find the variable called Path and edit that to include the full system path to where Git is installed. So for example, mine now reads:
%SystemRoot%\system32;%SystemRoot%; [snip] ;C:\Program Files (x86)\Git\bin
With the all important bit highlighted in bold. As with Ant and Android Development Tools, you'll need to include the /bin subfolder, too.