SageMathCell Server installation - errors in npm run build

76 views
Skip to first unread message

Varvara Karpova

unread,
Aug 3, 2022, 3:31:25 PM8/3/22
to sage-cell
Hi,
  • I have installed sagemath from packages 
  • I then tried to install a SageMathCell Server following the Simple Installation Guide from https://github.com/sagemath/sagecell :
    • Steps 1 and 3 went OK, 
    • I omittted Step 2, since I already have sage installed. (and the system won't let me overwrite it)
  • In Step 4, the directory sagecell was built at  /home/varvara/sagecell , but after running  
$  sage -sh -c make

webpack 5.69.1 compiles with 6 errors.  Below you will find the error output.

My questions are: 
1) could these errors be related to the fact that I haven't installed sage from github (i.e., ommited step 2)? 

1') if yes, how do I properly uninstall sage and the sagecell directory to try the instation process from https://github.com/sagemath/sagecell (including Step 2) over again?

2) if the errors aren't related to the way I installed sage, how can I solve them? 
It feels like there might be a (related) path error somewhere (files are copied / sourced from a wrong directory), but after a lot of googling about webpack errors I still wasn't able to fix them, unfortunately. 

I would be grateful for any tipps.


-----------------------------------------  ERROR output 

$ sage -sh -c make
npm run build

> embedded_s...@1.0.0 build
> webpack --mode production

assets by status 817 KiB [cached] 1 asset
runtime modules 1.02 KiB 6 modules
modules by path ./node_modules/ 1.57 MiB 160 modules
modules by path ./js/ 123 KiB
  ./js/main.js 5.18 KiB [built] [code generated]
  ./js/sagecell.js 302 bytes [built] [code generated]
  ./js/cell.js 13.5 KiB [built] [code generated]
  + 14 modules
modules by path ./build/vendor/ 36.3 KiB
  ./build/vendor/colorpicker.js 19.2 KiB [built] [code generated]
  ./build/vendor/colorpicker.css 3.55 KiB [built] [code generated]
  ./build/vendor/fontawesome.css 2.27 KiB [built] [code generated]
  ./build/vendor/sagecell.css 11.2 KiB [built] [code generated]

ERROR in ./js/interact_cell.js
Module not found: Error: Can't resolve 'base/js/events' in '/home/varvara/sagecell/js'
resolve 'base/js/events' in '/home/varvara/sagecell/js'
  Parsed request is a module
  using description file: /home/varvara/sagecell/package.json (relative path: ./js)
    resolve as module
      looking for modules in /home/varvara/sagecell/build/vendor
        /home/varvara/sagecell/build/vendor/base doesn't exist
      looking for modules in /home/varvara/sagecell/node_modules
        existing directory /home/varvara/sagecell/node_modules/base
          using description file: /home/varvara/sagecell/node_modules/base/package.json (relative
path: .)
            using description file: /home/varvara/sagecell/node_modules/base/package.json (relative path: ./js/events)
              Field 'browser' doesn't contain a valid alias configuration
              /home/varvara/sagecell/node_modules/base/js/events doesn't exist
              .webpack.js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/events.webpack.js doesn't exist      
              .web.js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/events.web.js doesn't exist
              .js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/events.js doesn't exist
              as directory
                /home/varvara/sagecell/node_modules/base/js/events doesn't exist
 @ ./js/session.js
 @ ./js/cell.js
 @ ./js/main.js

ERROR in ./js/session.js
Module not found: Error: Can't resolve 'base/js/events' in '/home/varvara/sagecell/js'
resolve 'base/js/events' in '/home/varvara/sagecell/js'
  Parsed request is a module
  using description file: /home/varvara/sagecell/package.json (relative path: ./js)
    resolve as module
      looking for modules in /home/varvara/sagecell/build/vendor
        /home/varvara/sagecell/build/vendor/base doesn't exist
      looking for modules in /home/varvara/sagecell/node_modules
        existing directory /home/varvara/sagecell/node_modules/base
          using description file: /home/varvara/sagecell/node_modules/base/package.json (relative
path: .)
            using description file: /home/varvara/sagecell/node_modules/base/package.json (relative path: ./js/events)
              Field 'browser' doesn't contain a valid alias configuration
              /home/varvara/sagecell/node_modules/base/js/events doesn't exist
              .webpack.js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/events.webpack.js doesn't exist      
              .web.js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/events.web.js doesn't exist
              .js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/events.js doesn't exist
              as directory
                /home/varvara/sagecell/node_modules/base/js/events doesn't exist
 @ ./js/cell.js
 @ ./js/main.js

ERROR in ./js/session.js
Module not found: Error: Can't resolve 'base/js/namespace' in '/home/varvara/sagecell/js'
resolve 'base/js/namespace' in '/home/varvara/sagecell/js'
  Parsed request is a module
  using description file: /home/varvara/sagecell/package.json (relative path: ./js)
    resolve as module
      looking for modules in /home/varvara/sagecell/build/vendor
        /home/varvara/sagecell/build/vendor/base doesn't exist
      looking for modules in /home/varvara/sagecell/node_modules
        existing directory /home/varvara/sagecell/node_modules/base
          using description file: /home/varvara/sagecell/node_modules/base/package.json (relative
path: .)
            using description file: /home/varvara/sagecell/node_modules/base/package.json (relative path: ./js/namespace)
              Field 'browser' doesn't contain a valid alias configuration
              /home/varvara/sagecell/node_modules/base/js/namespace doesn't exist
              .webpack.js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/namespace.webpack.js doesn't exist    
              .web.js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/namespace.web.js doesn't exist        
              .js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/namespace.js doesn't exist
              as directory
                /home/varvara/sagecell/node_modules/base/js/namespace doesn't exist
 @ ./js/cell.js
 @ ./js/main.js

ERROR in ./js/session.js
Module not found: Error: Can't resolve 'services/kernels/kernel' in '/home/varvara/sagecell/js'  
resolve 'services/kernels/kernel' in '/home/varvara/sagecell/js'
  Parsed request is a module
  using description file: /home/varvara/sagecell/package.json (relative path: ./js)
    resolve as module
      looking for modules in /home/varvara/sagecell/build/vendor
        /home/varvara/sagecell/build/vendor/services doesn't exist
      looking for modules in /home/varvara/sagecell/node_modules
        /home/varvara/sagecell/node_modules/services doesn't exist
 @ ./js/cell.js
 @ ./js/main.js

ERROR in ./js/utils.js
Module not found: Error: Can't resolve 'base/js/utils' in '/home/varvara/sagecell/js'
resolve 'base/js/utils' in '/home/varvara/sagecell/js'
  Parsed request is a module
  using description file: /home/varvara/sagecell/package.json (relative path: ./js)
    resolve as module
      looking for modules in /home/varvara/sagecell/build/vendor
        /home/varvara/sagecell/build/vendor/base doesn't exist
      looking for modules in /home/varvara/sagecell/node_modules
        existing directory /home/varvara/sagecell/node_modules/base
          using description file: /home/varvara/sagecell/node_modules/base/package.json (relative
path: .)
            using description file: /home/varvara/sagecell/node_modules/base/package.json (relative path: ./js/utils)
              Field 'browser' doesn't contain a valid alias configuration
              /home/varvara/sagecell/node_modules/base/js/utils doesn't exist
              .webpack.js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/utils.webpack.js doesn't exist        
              .web.js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/utils.web.js doesn't exist
              .js
                Field 'browser' doesn't contain a valid alias configuration
                /home/varvara/sagecell/node_modules/base/js/utils.js doesn't exist
              as directory
                /home/varvara/sagecell/node_modules/base/js/utils doesn't exist
 @ ./js/cell.js
 @ ./js/main.js

ERROR in ./js/widgets.js
Module not found: Error: Can't resolve 'mpl' in '/home/varvara/sagecell/js'
resolve 'mpl' in '/home/varvara/sagecell/js'
  Parsed request is a module
  using description file: /home/varvara/sagecell/package.json (relative path: ./js)
    resolve as module
      looking for modules in /home/varvara/sagecell/build/vendor
        single file module
          using description file: /home/varvara/sagecell/package.json (relative path: ./build/vendor/mpl)
            /home/varvara/sagecell/build/vendor/mpl doesn't exist
            .webpack.js
              /home/varvara/sagecell/build/vendor/mpl.webpack.js doesn't exist
            .web.js
              /home/varvara/sagecell/build/vendor/mpl.web.js doesn't exist
            .js
              /home/varvara/sagecell/build/vendor/mpl.js doesn't exist
        /home/varvara/sagecell/build/vendor/mpl doesn't exist
      looking for modules in /home/varvara/sagecell/node_modules
        single file module
          using description file: /home/varvara/sagecell/package.json (relative path: ./node_modules/mpl)
            /home/varvara/sagecell/node_modules/mpl doesn't exist
            .webpack.js
              /home/varvara/sagecell/node_modules/mpl.webpack.js doesn't exist
            .web.js
              /home/varvara/sagecell/node_modules/mpl.web.js doesn't exist
            .js
              /home/varvara/sagecell/node_modules/mpl.js doesn't exist
        /home/varvara/sagecell/node_modules/mpl doesn't exist
 @ ./js/session.js
 @ ./js/cell.js
 @ ./js/main.js

webpack 5.69.1 compiled with 6 errors in 17394 ms
make: *** [Makefile:42: static/embedded_sagecell.js] Error 1





 

Varvara Karpova

unread,
Aug 8, 2022, 6:20:40 AM8/8/22
to sage-cell
Update:
Hi,
I was able to fix 5 of the 6 errors metioned above, but I am still getting one error during npm run build, which prevents me from installing SageMathCell (see output below).

As far as I understand it, it boils down to the fact that the files/folders mpl, mpl.webpack.js, mpl.web.js, mpl.js have not been copied to the directory /home/varvara/sagecell/build/vendor during installation.

However l.33 in the Makefile at https://github.com/sagemath/sagecell  states

python3 -c "from matplotlib.backends.backend_webagg_core import FigureManagerWebAgg; f = open('build/vendor/mpl.js', 'w'); f.write(FigureManagerWebAgg.get_javascript())"

Does anyone have an idea, where the problem is coming from and how I can fix it? 
Thanks!!



--- console output after running $ ../sage/sage -sh -c make ---

npm run build

 

> embedded_s...@1.0.0 build

> webpack --mode production

 

assets by status 1.13 MiB [cached] 1 asset

runtime modules 1010 bytes 5 modules

modules by path ./node_modules/ 2.22 MiB 298 modules

modules by path ./js/ 123 KiB

  ./js/main.js 5.18 KiB [built] [code generated]

  ./js/sagecell.js 302 bytes [built] [code generated]

  ./js/cell.js 13.5 KiB [built] [code generated]

  + 14 modules

modules by path ./build/vendor/ 133 KiB

  modules by path ./build/vendor/base/js/*.js 44.2 KiB 3 modules

  modules by path ./build/vendor/services/kernels/*.js 52.5 KiB 3 modules

  modules by path ./build/vendor/*.css 17 KiB 3 modules

  ./build/vendor/colorpicker.js 19.2 KiB [built] [code generated]


ERROR in ./js/widgets.js

Module not found: Error: Can't resolve 'mpl' in '/home/varvara/sagecell/js'

resolve 'mpl' in '/home/varvara/sagecell/js'

  Parsed request is a module

  using description file: /home/varvara/sagecell/package.json (relative path: ./js)      

    Field 'browser' doesn't contain a valid alias configuration

    resolve as module

      /home/varvara/sagecell/js/build/vendor doesn't exist or is not a directory

      /home/varvara/sagecell/js/node_modules doesn't exist or is not a directory

      looking for modules in /home/varvara/sagecell/build/vendor

        single file module

          using description file: /home/varvara/sagecell/package.json (relative path: ./build/vendor/mpl)

            Field 'browser' doesn't contain a valid alias configuration

            /home/varvara/sagecell/build/vendor/mpl doesn't exist

            .webpack.js

              Field 'browser' doesn't contain a valid alias configuration

              /home/varvara/sagecell/build/vendor/mpl.webpack.js doesn't exist

            .web.js

              Field 'browser' doesn't contain a valid alias configuration

              /home/varvara/sagecell/build/vendor/mpl.web.js doesn't exist

            .js

              Field 'browser' doesn't contain a valid alias configuration

              /home/varvara/sagecell/build/vendor/mpl.js doesn't exist

        /home/varvara/sagecell/build/vendor/mpl doesn't exist

      looking for modules in /home/varvara/sagecell/node_modules

        single file module

          using description file: /home/varvara/sagecell/package.json (relative path: ./node_modules/mpl)

            Field 'browser' doesn't contain a valid alias configuration

            /home/varvara/sagecell/node_modules/mpl doesn't exist

            .webpack.js

              Field 'browser' doesn't contain a valid alias configuration

              /home/varvara/sagecell/node_modules/mpl.webpack.js doesn't exist

            .web.js

              Field 'browser' doesn't contain a valid alias configuration

              /home/varvara/sagecell/node_modules/mpl.web.js doesn't exist

            .js

              Field 'browser' doesn't contain a valid alias configuration

              /home/varvara/sagecell/node_modules/mpl.js doesn't exist

        /home/varvara/sagecell/node_modules/mpl doesn't exist

      /home/varvara/build/vendor doesn't exist or is not a directory

      /home/varvara/node_modules doesn't exist or is not a directory

      /home/build/vendor doesn't exist or is not a directory

      /home/node_modules doesn't exist or is not a directory

      /build/vendor doesn't exist or is not a directory

      /node_modules doesn't exist or is not a directory

 @ ./js/session.js

 @ ./js/cell.js

 @ ./js/main.js

 

webpack 5.74.0 compiled with 1 error in 23305 ms

make: *** [Makefile:42: static/embedded_sagecell.js] Error 1

------

Andrey Novoseltsev

unread,
Aug 12, 2022, 1:10:08 AM8/12/22
to sage-cell
Hi Varvara!

Thank you so much for your interest in trying out the installation and persevering through the problems! I have always compiled sage from source, so not entirely sure what can go wrong when one is using a system package instead. Given that you have succeeded in fixing other errors, perhaps the last step is just to make sure that the command creating mpl files is executed. Either run it directly yourself or pass -B to make to force complete rebuild (assuming that it does not bring back the problems you have already solved).

If you have suggestions on how to improve Makefile, pull requests or suggestions are very welcome!

Andrey

Varvara Karpova

unread,
Sep 2, 2022, 1:52:33 AM9/2/22
to sage-cell
Hi Andrey,

Thank you for your answer and hints! I was away from the project for a couple of weeks, and have just got back to it, thus my delayed reaction. 
I used a sage version compiled from source and reinstalled the sage cell server from scratch again, passing -B to make to force complete rebuild, as you suggested. There were warnings, but it worked, so it's great! 

Varvara

Reply all
Reply to author
Forward
0 new messages