CDash icon indicating copy to clipboard operation
CDash copied to clipboard

Error 'MODULE_NOT_FOUND' at a fresh install

Open Scanframe opened this issue 2 years ago • 2 comments
trafficstars

Contents

  • Reported Error
  • Question
  • Versions
  • NPM-Check Result

Reported Error

When running the last step of a fresh install using npm run dev the result with error is:

> [email protected] dev
> npm run development


> [email protected] development
> mix

[webpack-cli] Error: Cannot find module './src/table'
Require stack:
- /var/www/cdash/node_modules/cli-table3/index.js
- /var/www/cdash/node_modules/laravel-mix/src/webpackPlugins/BuildOutputPlugin.js
- /var/www/cdash/node_modules/laravel-mix/src/builder/webpack-plugins.js
- /var/www/cdash/node_modules/laravel-mix/src/builder/WebpackConfig.js
- /var/www/cdash/node_modules/laravel-mix/src/Mix.js
- /var/www/cdash/node_modules/laravel-mix/setup/webpack.config.js
- /var/www/cdash/node_modules/webpack-cli/lib/webpack-cli.js
- /var/www/cdash/node_modules/webpack-cli/lib/bootstrap.js
- /var/www/cdash/node_modules/webpack-cli/bin/cli.js
- /var/www/cdash/node_modules/webpack/bin/webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/var/www/cdash/node_modules/cli-table3/index.js:1:18)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/var/www/cdash/node_modules/cli-table3/index.js',
    '/var/www/cdash/node_modules/laravel-mix/src/webpackPlugins/BuildOutputPlugin.js',
    '/var/www/cdash/node_modules/laravel-mix/src/builder/webpack-plugins.js',
    '/var/www/cdash/node_modules/laravel-mix/src/builder/WebpackConfig.js',
    '/var/www/cdash/node_modules/laravel-mix/src/Mix.js',
    '/var/www/cdash/node_modules/laravel-mix/setup/webpack.config.js',
    '/var/www/cdash/node_modules/webpack-cli/lib/webpack-cli.js',
    '/var/www/cdash/node_modules/webpack-cli/lib/bootstrap.js',
    '/var/www/cdash/node_modules/webpack-cli/bin/cli.js',
    '/var/www/cdash/node_modules/webpack/bin/webpack.js'
  ]
}

Question

What am I doing wrong?

Versions

Versions used for this install.

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

php -v
PHP 8.1.2-1ubuntu2.10 (cli) (built: Jan 16 2023 15:19:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.10, Copyright (c), by Zend Technologies

mysql --version
mysql  Ver 8.0.32-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu))

node --version
v12.22.9

npm --version
8.5.1

git remote -v
origin  https://github.com/Kitware/CDash (fetch)
origin  https://github.com/Kitware/CDash (push)

git branch -v
* master 45086af Merge pull request #1297 from Kitware/fix_style

NPM-Check Result

angular                       😕  NOTUSED?  Still using angular?
                                           Depcheck did not find code similar to require('angular') or import from 'angular'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["angular"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall angular --save

angular-animate               😍  UPDATE!   Your local install is out of date. http://angularjs.org
                                           npm install [email protected] --save to go from 1.8.2 to 1.8.3

angular-ui-sortable           😎  NEW VER!  NonSemver update available. http://angular-ui.github.com
                                           npm install [email protected] --save to go from 0.14.4 to 0.19.0

ansi_up                       😎  MAJOR UP  Major update available. https://github.com/drudru/ansi_up#readme
                                           npm install [email protected] --save to go from 3.0.0 to 5.1.0

as-jqplot                     😕  NOTUSED?  Still using as-jqplot?
                                           Depcheck did not find code similar to require('as-jqplot') or import from 'as-jqplot'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["as-jqplot"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall as-jqplot --save

autoprefixer                  😎  PATCH UP  Patch update available. https://github.com/postcss/autoprefixer#readme
                                           npm install [email protected] --save to go from 10.4.5 to 10.4.13
                              😕  NOTUSED?  Still using autoprefixer?
                                           Depcheck did not find code similar to require('autoprefixer') or import from 'autoprefixer'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["autoprefixer"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall autoprefixer --save

axios                         😎  MAJOR UP  Major update available. https://axios-http.com
                                           npm install [email protected] --save to go from 0.21.4 to 1.3.3

bootstrap                     😎  MAJOR UP  Major update available. https://getbootstrap.com/
                                           npm install [email protected] --save to go from 4.6.1 to 5.2.3

bootstrap-vue                 😍  UPDATE!   Your local install is out of date. https://bootstrap-vue.org
                                           npm install [email protected] --save to go from 2.21.2 to 2.23.1

cross-env                     😎  MAJOR UP  Major update available. https://github.com/kentcdodds/cross-env#readme
                                           npm install [email protected] --save to go from 5.2.1 to 7.0.3
                              😕  NOTUSED?  Still using cross-env?
                                           Depcheck did not find code similar to require('cross-env') or import from 'cross-env'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["cross-env"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall cross-env --save

d3                            😎  MAJOR UP  Major update available. https://d3js.org
                                           npm install [email protected] --save to go from 3.5.17 to 7.8.2

del                           😎  MAJOR UP  Major update available. https://github.com/sindresorhus/del#readme
                                           npm install [email protected] --save to go from 2.2.2 to 7.0.0

eslint                        😎  MAJOR UP  Major update available. https://eslint.org
                                           npm install [email protected] --save to go from 7.32.0 to 8.34.0

eslint-plugin-vue             😎  MAJOR UP  Major update available. https://eslint.vuejs.org
                                           npm install [email protected] --save to go from 7.20.0 to 9.9.0

eslint-webpack-plugin         😎  MAJOR UP  Major update available. https://github.com/webpack-contrib/eslint-webpack-plugin
                                           npm install [email protected] --save to go from 2.5.4 to 4.0.0

flot                          😍  UPDATE!   Your local install is out of date. https://github.com/flot/flot#readme
                                           npm install [email protected] --save to go from 4.2.2 to 4.2.3
                              😕  NOTUSED?  Still using flot?
                                           Depcheck did not find code similar to require('flot') or import from 'flot'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["flot"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall flot --save

git-revision-webpack-plugin   😎  MAJOR UP  Major update available. https://github.com/pirelenito/git-revision-webpack-plugin
                                           npm install [email protected] --save to go from 3.0.6 to 5.0.0

jquery                        😍  UPDATE!   Your local install is out of date. https://jquery.com
                                           npm install [email protected] --save to go from 3.6.0 to 3.6.3

jquery-ui-dist                😍  UPDATE!   Your local install is out of date. http://jqueryui.com
                                           npm install [email protected] --save to go from 1.13.1 to 1.13.2
                              😕  NOTUSED?  Still using jquery-ui-dist?
                                           Depcheck did not find code similar to require('jquery-ui-dist') or import from 'jquery-ui-dist'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["jquery-ui-dist"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall jquery-ui-dist --save

jquery.cookie                 😕  NOTUSED?  Still using jquery.cookie?
                                           Depcheck did not find code similar to require('jquery.cookie') or import from 'jquery.cookie'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["jquery.cookie"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall jquery.cookie --save

ng-file-upload                😕  NOTUSED?  Still using ng-file-upload?
                                           Depcheck did not find code similar to require('ng-file-upload') or import from 'ng-file-upload'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["ng-file-upload"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall ng-file-upload --save

nvd3                          😕  NOTUSED?  Still using nvd3?
                                           Depcheck did not find code similar to require('nvd3') or import from 'nvd3'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["nvd3"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall nvd3 --save

sass                          😍  UPDATE!   Your local install is out of date. https://github.com/sass/dart-sass
                                           npm install [email protected] --save to go from 1.43.4 to 1.58.1
                              😕  NOTUSED?  Still using sass?
                                           Depcheck did not find code similar to require('sass') or import from 'sass'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["sass"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall sass --save

sass-loader                   😎  MAJOR UP  Major update available. https://github.com/webpack-contrib/sass-loader
                                           npm install [email protected] --save to go from 11.1.1 to 13.2.0
                              😕  NOTUSED?  Still using sass-loader?
                                           Depcheck did not find code similar to require('sass-loader') or import from 'sass-loader'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["sass-loader"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall sass-loader --save

vue                           😎  MAJOR UP  Major update available. https://github.com/vuejs/core/tree/main/packages/vue#readme
                                           npm install [email protected] --save to go from 2.6.14 to 3.2.47

vue-loader                    😎  MAJOR UP  Major update available. https://github.com/vuejs/vue-loader#readme
                                           npm install [email protected] --save to go from 15.9.8 to 17.0.1
                              😕  NOTUSED?  Still using vue-loader?
                                           Depcheck did not find code similar to require('vue-loader') or import from 'vue-loader'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["vue-loader"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall vue-loader --save

vue-template-compiler         😍  UPDATE!   Your local install is out of date. https://github.com/vuejs/vue/tree/dev/packages/vue-template-compiler#readme
                                           npm install [email protected] --save to go from 2.6.14 to 2.7.14

webpack                       😍  UPDATE!   Your local install is out of date. https://github.com/webpack/webpack
                                           npm install [email protected] --save to go from 5.63.0 to 5.75.0

@vue/test-utils               😎  MAJOR UP  Major update available. https://github.com/vuejs/test-utils
                                           npm install @vue/[email protected] --save-dev to go from 1.2.2 to 2.2.10

@vue/vue2-jest                😎  MAJOR UP  Major update available. https://github.com/vuejs/vue-jest
                                           npm install @vue/[email protected] --save-dev to go from 27.0.0 to 29.2.2
                              😕  NOTUSED?  Still using @vue/vue2-jest?
                                           Depcheck did not find code similar to require('@vue/vue2-jest') or import from '@vue/vue2-jest'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["@vue/vue2-jest"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall @vue/vue2-jest --save-dev

axios-mock-adapter            😍  UPDATE!   Your local install is out of date. https://github.com/ctimmerm/axios-mock-adapter#readme
                                           npm install [email protected] --save-dev to go from 1.20.0 to 1.21.2

expect                        😎  MAJOR UP  Major update available. https://github.com/facebook/jest#readme
                                           npm install [email protected] --save-dev to go from 27.3.1 to 29.4.3

jest                          😎  MAJOR UP  Major update available. https://jestjs.io/
                                           npm install [email protected] --save-dev to go from 27.3.1 to 29.4.3

postcss                       😍  UPDATE!   Your local install is out of date. https://postcss.org/
                                           npm install [email protected] --save-dev to go from 8.3.11 to 8.4.21

protractor                    😕  NOTUSED?  Still using protractor?
                                           Depcheck did not find code similar to require('protractor') or import from 'protractor'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["protractor"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall protractor --save-dev

resolve-url-loader            😕  NOTUSED?  Still using resolve-url-loader?
                                           Depcheck did not find code similar to require('resolve-url-loader') or import from 'resolve-url-loader'.
                                           Check your code before removing as depcheck isn't able to foresee all ways dependencies can be used.
                                           Use rc file options to remove unused check, but still monitor for outdated version:
                                               .npmcheckrc {"depcheck": {"ignoreMatches": ["resolve-url-loader"]}}
                                           Use --skip-unused to skip this check.
                                           To remove this package: npm uninstall resolve-url-loader --save-dev

glob                          😟  PKG ERR!  Not in the package.json. Found in: /webpack.mix.js
                              😎  MAJOR UP  Major update available. https://github.com/isaacs/node-glob#readme
                                           npm install [email protected] --save to go from 7.2.0 to 8.1.0

variables                     😟  MISSING!  Not installed.
                              😟  PKG ERR!  Not in the package.json. Found in: /resources/sass/app.scss

Scanframe avatar Feb 16 '23 12:02 Scanframe

Thanks for taking the time to write such a detailed error report. I'm having trouble reproducing this issue using the same version of Ubuntu and npm. Can you try the following steps & let us know how it goes?

cd /path/to/CDash
rm -r node_modules
npm install
npm run dev

zackgalbreath avatar Feb 16 '23 15:02 zackgalbreath

Thanks for taking the time to write such a detailed error report. I'm having trouble reproducing this issue using the same version of Ubuntu and npm. Can you try the following steps & let us know how it goes?

cd /path/to/CDash
rm -r node_modules
npm install
npm run dev

Thanks. Deleting directory "node_modules" did the trick to run npm run dev without errors.

Now I have another problem when I open my browser and index.php redirects to install.php and it does not exist in path/to/CDash/public. There is indeed no install.php at that location.

I can find install.php it in path/to/CDash/app/cdash/public but when I configure that directory in Apache it reports an error in the log.

Apache Error Log

[Fri Feb 17 08:01:20.941031 2023] [mpm_prefork:notice] [pid 12318] AH00163: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
[Fri Feb 17 08:01:20.941067 2023] [core:notice] [pid 12318] AH00094: Command line: '/usr/sbin/apache2'
[Fri Feb 17 08:01:59.396062 2023] [php:error] [pid 37485] [client 192.168.178.101:46946] PHP Fatal error:  Uncaught Error: Call to undefined function config() in /var/www/cdash/app/cdash/public/index.php:19\nStack trace:\n#0 {main}\n  thrown in /var/www/cdash/app/cdash/public/index.php on line 19
[Fri Feb 17 08:02:00.434948 2023] [php:error] [pid 37486] [client 192.168.178.101:46950] PHP Fatal error:  Uncaught Error: Call to undefined function config() in /var/www/cdash/app/cdash/public/index.php:19\nStack trace:\n#0 {main}\n  thrown in /var/www/cdash/app/cdash/public/index.php on line 19
[Fri Feb 17 08:03:50.220936 2023] [mpm_prefork:notice] [pid 12318] AH00173: SIGHUP received.  Attempting to restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[Fri Feb 17 08:03:50.261726 2023] [mpm_prefork:notice] [pid 12318] AH00163: Apache/2.4.52 (Ubuntu) configured -- resuming normal operations
[Fri Feb 17 08:03:50.261763 2023] [core:notice] [pid 12318] AH00094: Command line: '/usr/sbin/apache2'
[Fri Feb 17 08:03:55.282190 2023] [php:error] [pid 37525] [client 192.168.178.101:35486] script '/var/www/cdash/public/install.php' not found or unable to stat

Scanframe avatar Feb 17 '23 07:02 Scanframe