Meteor error EACCES, permission denied '/var/www/' - meteor

I am building a meteor app that uses manuel:reactivearray package for making reactive arrays.
I do not know what happened but as i installed the package wrote some sample code and waited for the update i am getting this error:
/home/leocrawf/.meteor/packages/meteor- tool/.1.1.10.1l2mozl++os.linux.x86_32+web.browser+web.cordova/mt-os.linux.x86_32/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20160126-16:57:19.116(-5)? (STDERR) throw(ex);
W20160126-16:57:19.116(-5)? (STDERR) ^
W20160126-16:57:19.371(-5)? (STDERR) Error: EACCES, permission denied '/var/www/
I have done every thing from delete the build folder, delete the meteor folder and added all the packages anew excepting manuel:reactivearray but still the same error. Development is now halted until i get rid of this. Any idea how to remove this problem? I am using meteor 1.2.1.

Check the file permissions on that folder and it's sub folders (both user and group) using ls -la on the command line. The user should map to the current user you are running meteor as, which in this case appears to be leocrawf. If you plan on running meteor in /var/www as leocrawf, then you would need to run this command to change the file permissions to that user:
chown -R leocrawf /var/www
Personally I set up explicit users specifically for each instance, so I have a user called DEV who uses the /var/www/DEV folder to run meteor.

Related

Laravel & Valet: Failed to open stream

I'm trying to setup a Laravel project on Valet.
I'm getting this error:
Warning: require(/Users/davina/Developer/learn-laravel-graphql/public/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/davina/Developer/learn-laravel-graphql/public/index.php on line 24
Fatal error: require(): Failed opening required '/Users/davina/Developer/learn-laravel-graphql/public/../vendor/autoload.php' (include_path='.:/usr/local/Cellar/php/7.3.1/share/php/pear') in /Users/davina/Developer/learn-laravel-graphql/public/index.php on line 24
Trying to link either the project root or /public folders results in the above error instead of Laravel's default welcome screen.
How do I resolve this?
Try to navigate to the project folder root and run the command:
composer -i
sudo chmod 755 -R folder_name
Create the .env file, if is fresh application just copy the content of the .env.example file.
inside the project folder again: php artisan key:generate
After those steps all up and running for me :)
Solves the issue for me.
Looks like you have a fresh installation of laravel here...or, you just cloned the repo?
If so, the first thing you should do is to try and install the packages that Laravel uses.
Within those packages is a file called "autoload.php" which your server is looking for here.
Now, to do that, simply navigate within your terminal to the directory of your project and run: composer install.
Wait for it to finish and then, try to continue from there.

"EACCES: permission denied" when using "firebase serve"

I am using "firebase serve" to test my Firebase web app locally. I ran into this error every time:
Error: EACCES: permission denied, open
'/Users/[my_user_name]/.config/configstore/#google-cloud/functions-emulator/.functions.json'
You don't have access to this file.
Error: EACCES: permission denied, open
'/usr/local/lib/node_modules/firebase-tools/node_modules/#google-cloud/functions-emulator/logs/cloud-functions-emulator.log'
It does work with a sudo. But I don't want to type in my sudo password every time. Every other command works fine without sudo except for this one.
If you don't want to run sudo every time, you need to install node in your home directory where you have full control. Don't use the node that you may have installed with a package manager using the system's default settings. The typical tool to help you with a home directory installation is Node Version Manager (nvm).

"firebase serve --only functions" breaks after moving project folder

I've been working on a Firebase functions project, running the service locally for testing.
It was all working fine, but then I moved the source folder to a new location (into source control), and now it won't run, because something, somewhere remembers the old location of the project.
So where the heck is Firebase 'remembering' the original location of the project/source?
And how do I fix it?
More info:
Platform: Windows 7
Node: v6.11.1 (as advised by: https://cloud.google.com/functions/docs/writing)
Below is what the output looks like when I run 'firebase serve --only functions' and hit the service URL.
Ignore the lines with "Failed to emulate..." and "No HTTPS..." - That is normal.
The next "error:" line, and the rest is emitted when the URL is hit.
The important points are:
a) The folder my project is in is shown on the first line (In standard Windows CMD prompt fashion)
b) The "Cannot find module" error is looking in A COMPLETELY DIFFERENT
FOLDER. In fact, it is looking where the project USED to be.
D:\_DEV\svn\FredSays\onGoogleAssistant\functions>firebase serve --only functions
=== Serving from 'D:\_DEV\svn\FredSays\onGoogleAssistant'...
i functions: Preparing to emulate HTTPS functions. Support for other event types coming soon.
! functions: Failed to emulate FredSays
i functions: No HTTPS functions emulated. Support for other function types are coming soon.
error: module.js:471
throw err;
^
Error: Cannot find module 'D:\_DEV\FredSays\actionssdk-say-number-nodejs-master\functions'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at process.on.e (D:\_TOOLS\nvm\v6.11.1\node_modules\firebase-tools\node_modules\#google-cloud\functions-emulator\src\supervisor\worker.js:64:28)
at emitTwo (events.js:106:13)
at process.emit (events.js:191:7)
at process.nextTick (internal/child_process.js:758:12)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
error: Function worker crashed with exit code: 1
I can't find anything in the project tree listing the old location.
I've tried all of the following:
npm cache clean
firebase init functions
firebase logout & firebase login
DEL /S /Q node_modules & npm install
npm uninstall -g firebase-tools & npm install -g firebase-tools
All of the above are no help.
Please help. My project is dead in the water right now.
I came across your post whilst researching the same problem on my Ubuntu dev environment. I copied some code from an NFS share to my home directory and can't for the life of me get it to run in the functions emulator - one of the issues was that the code was still being run on the NFS mounted path and not the local path where I was running VS Code.
The command you need to re-home the code after you move it is
$firebase use
Active Project: fbgo-9f73a
Project aliases for /home/user/firebase/chappy:
* default (site-ID)
Run firebase use --add to define a new project alias.
then start the emulator
$ firebase serve --only functions,hosting
=== Serving from '/home/user/firebase/chappy'...
i functions: Preparing to emulate functions.
i hosting: Serving hosting files from: public
✔ hosting: Local server: http://localhost:5000
✔ functions: app: http://localhost:5003/site-ID/us-central1/app
Unfortunately I don't have a 'before and after' on this to be 100% sure, please let me know if this fixes it for you.

Symfony 2 fatal error on cache directory

I ssh to my VPS where there is a vagrant box that runs a symfony project.
When i try to access the project i am getting the error:
`Fatal error: Uncaught RuntimeException: Failed to write cache file` and
`Fatal error: Uncaught exception 'RuntimeException' with message 'Could not create cache directory`
I have tried fixing file permissions as mentioned here: http://symfony.com/doc/current/setup/file_permissions.html
and even changed chmod to 777. But still getting same error.
I also tried everything there: symfony2 : failed to write cache directory
It just won't work. Any help would be much appreciated.
My VPS is running ubuntu 16.04 and vagrant is latest version with image ubuntu/trusty
If you are running Apache check your /etc/httpd/conf/httpd.conf file and find your entry for your website in there. Check to see what user Apache is running the site as. You'll want to make sure the directories and files that make up your Symfony app belong to that user and the group the user is in as well. If you are logged in as root and are in the your Symfony directory you can run:
chown -R user:group *
to change all the files and directories to that user and group. Note to replace user and group in the command above with the actual username and group.
If you still have troubles after you've found the user apache is running as, try removing your symfony files completely (if it is a fresh project that you haven' been working on) and rebuild it while you are superuser'd (su) as that user. You probably built your project as root or another user.

How to rename a Symfony 2 installation folder correctly?

I install Symfony 2.3.0-DEV this way:
composer self-update
git clone https://github.com/symfony/symfony-standard test1
copy .\test1\app\config\parameters.yml .\test1\app\config\parameters.yml.dist
composer install
But, Every time I've had to rename (ie. to "test2") the project folder. My installation breaks and shows errors:
Warning: require_once(C:\xampp\htdocs\symfony-projects\test1\web/../app/bootstrap.php.cache): failed to open stream: No such file or directory in C:\xampp\htdocs\symfony-projects\test1\web\app_dev.php on line 19
Fatal error: require_once(): Failed opening required 'C:\xampp\htdocs\symfony-projects\test1\web/../app/bootstrap.php.cache' (include_path='.;\xampp\php\PEAR') in C:\xampp\htdocs\symfony-projects\test1\web\app_dev.php on line 19
I tried, deleting cache folders, deleting the bootstrap.cache.php file, and re-installing/updating vendors, including the autoloader, also with cache:warmup and cache:clear, changing permissions. And still nothing...
Finally solved it ! That's what I've done.
composer self-update
git clone https://github.com/symfony/symfony-standard test1
copy .\test1\app\config\parameters.yml .\test1\app\config\parameters.yml.dist
composer install
Loaded http://localhost/symfony-projects/test1/web/app_dev.php once.
Closed the browser (chrome), stopped xampp (apache/mysql), and the powershell
Deleted /app/cache/* and /app/bootstrap.php.cache file
Closed the IDE, Logoff my user session in Windows 8 (starting feeling paranoid)
Renamed the folder test1 to test2
Executed composer update command to call post-update-cmd scripts to be sure that bootstrap.php.cache is rebuild
Went to http://localhost/symfony-projects/test2/web/app_dev.php
And then works. Probably that issue was due to locked files...
#Touki Thanks, the APC thing was a good insight but not needed it ;)
this topic is quite old but I just had the same problem. The problem was: I installed symfony2 using command:
php composer.phar create-project symfony/framework-standard-edition myProject 2.1.x-dev
but I had the same fatal error. However, my solution was to go myProject directory and run command:
composer update
And that is all, project was rebuilded and file "bootstrap.php.cache" appeard :)
I hope this helps.
Next time, just restart your machine.

Resources