austinkregel / finance

A self hosted app to help you get a better understanding of your personal finances.
405 stars 47 forks source link

Few errors encountered during installation #53

Closed smoreau closed 3 years ago

smoreau commented 3 years ago

After cloning the repository, I built the containers and didn't have any issues so far.

Following the documentation, I encountered this first error:

[root@test finance]# docker exec -it finance-node npm install
Error response from daemon: Container b65ec79cf554773eed9ad238845987547a8133c83b23e053d253d2469f19dc37 is not running

The workaround I used was to run the container using the command:

[root@test finance]# docker-compose run node bash
node@d4ff8d03361a:/$ cd /var/www/html/

But then, I got this second issue:

node@d4ff8d03361a:/var/www/html$ npm install
npm notice
npm notice New minor version of npm available! 7.0.15 -> 7.2.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.2.0
npm notice Run npm install -g npm@7.2.0 to update!
npm notice
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: vue@2.6.10
npm ERR! node_modules/vue
npm ERR!   dev vue@"^2.5.17" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^2.6.11" from @vue-responsive-dash/chartjs@0.1.3
npm ERR! node_modules/@vue-responsive-dash/chartjs
npm ERR!   @vue-responsive-dash/chartjs@"^0.1.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/node/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/node/.npm/_logs/2020-12-18T17_09_43_606Z-debug.log

To workaround this second problem, I used the command: npm install --force

From the documentation, I have to run the "npm run production" command but I got a third issue:

node@d4ff8d03361a:/var/www/html$ npm run production

> production
> cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration has an unknown property 'optimization'. These properties are valid:
   object { amd?, bail?, cache?, context?, dependencies?, devServer?, devtool?, entry, externals?, loader?, module?, name?, node?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, stat
s?, target?, watch?, watchOptions? }
   For typos: please correct them.
   For loader options: webpack 2 no longer allows custom properties in configuration.
     Loaders should be updated to allow passing options via loader options in module.rules.
     Until loaders are updated one can use the LoaderOptionsPlugin to pass these options to the loader:
     plugins: [
       new webpack.LoaderOptionsPlugin({
         // test: /\.xxx$/, // may apply this only for some modules
         options: {
           optimization: ...
         }
       })
     ]
 - configuration.stats should be one of these:
   object { all?, context?, hash?, version?, timings?, performance?, depth?, assets?, env?, colors?, maxModules?, chunks?, chunkModules?, modules?, children?, cached?, cachedAssets?, reasons?, source?, warnings?, errors?, warningsFilter?, excludeAssets?, excludeModules?,
 exclude?, entrypoints?, errorDetails?, chunkOrigins?, modulesSort?, moduleTrace?, chunksSort?, assetsSort?, publicPath?, providedExports?, usedExports?, optimizationBailout? } | boolean | "none" | "errors-only" | "minimal" | "normal" | "detailed" | "verbose"
   -> Used by the webpack CLI program to pass stats options.
   Details:
    * configuration.stats has an unknown property 'builtAt'. These properties are valid:
      object { all?, context?, hash?, version?, timings?, performance?, depth?, assets?, env?, colors?, maxModules?, chunks?, chunkModules?, modules?, children?, cached?, cachedAssets?, reasons?, source?, warnings?, errors?, warningsFilter?, excludeAssets?, excludeModule
s?, exclude?, entrypoints?, errorDetails?, chunkOrigins?, modulesSort?, moduleTrace?, chunksSort?, assetsSort?, publicPath?, providedExports?, usedExports?, optimizationBailout? }
    * configuration.stats should be a boolean.
    * configuration.stats should be one of these:
      "none" | "errors-only" | "minimal" | "normal" | "detailed" | "verbose"
npm ERR! code 1
npm ERR! path /var/www/html
npm ERR! command failed
npm ERR! command sh -c cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/node/.npm/_logs/2020-12-18T17_17_13_359Z-debug.log

And after all these steps and workaround, it doesn't work. I am not sure what I've done wrong.

austinkregel commented 3 years ago

:wave: Hello @smoreau !

I just wanted to touch base here, oddly enough despite having a dedicated node container it isn't used in (the latest revision of) the setup guide in the project wiki :smile:

I'll be sure to remove that container and remove any mention of it from the wiki :smiley:

The TL;DR of the wiki page is just this

 docker run -it -v "`pwd`:/app" -w /app node yarn
 docker run -it -v "`pwd`:/app" -w /app node yarn run dev
smoreau commented 3 years ago

Hello @austinkregel,

Thank you for your quick reply. To be honest, I didn't know about the wiki page.

I ran the setup guide for docker and the following commands worked perfectly fine:

docker-compose build
docker run -it -v "`pwd`:/app" -w /app node yarn
docker run -it -v "`pwd`:/app" -w /app node yarn run dev
docker-compose up -d

However, when I try to access the page from my browser, I got the following error:

Warning: require(/var/www/html/public/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/public/index.php on line 24

Fatal error: require(): Failed opening required '/var/www/html/public/../vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/html/public/index.php on line 24

It looks like the vendor folder has not been populated. Should I run another command to fix that?

austinkregel commented 3 years ago

@smoreau Oh no! Good catch! I'll add that to the wiki page too! The next steps would be the following:

 docker exec -it finance-php composer install
 docker exec -it finance-php php artisan storage:link
 docker exec -it finance-php php artisan key:generate
 docker exec -it finance-php php artisan migrate

(If these steps fail, you may have to manually copy over the .env.example file to .env, once that's done repeat starting at the failed step.)

After that you should be able to register an account. If you plan on updating your env to use the redis driver, you'll also need

 docker exec -it finance-php php artisan horizon

or if you're using the database driver

 docker exec -it finance-php php artisan queue:listen --tries=3
smoreau commented 3 years ago

Great! Thanks a lot, I got it to work now.