hydrogen: Uncaught Error: Cannot find module '$ATOM_HOME/packages/Hydrogen/node_modules/@nteract/mathjax/li...

[Enter steps to reproduce:]

Atom: 1.47.0 x64 Electron: 5.0.13 OS: Mac OS X 10.14.6 Thrown From: Hydrogen package 2.14.1

Stack Trace

Uncaught Error: Cannot find module ‘/Users/laura/.atom/packages/Hydrogen/node_modules/@nteract/mathjax/lib/index.js’. Please verify that the package.json has a valid “main” entry

At internal/modules/cjs/loader.js:248

Error: Cannot find module '/Users/laura/.atom/packages/Hydrogen/node_modules/@nteract/mathjax/lib/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:240:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:378:18)
    at Module._resolveFilename (internal/modules/cjs/loader.js:670:27)
    at Module._resolveFilename (/Applications/Atom.app/Contents/Resources/electron.asar/common/reset-search-paths.js:43:12)
    at Function.get_Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:155434)
    at Module.require (/app.asar/static/index.js:61:43)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146766)
    at /packages/Hydrogen/node_modules/@nteract/markdown/lib/markdown-render.js:13:30)
    at /packages/Hydrogen/node_modules/@nteract/markdown/lib/markdown-render.js:30:3)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147450)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150998)
    at Module.load (internal/modules/cjs/loader.js:701:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:633:12)
    at Function.Module._load (internal/modules/cjs/loader.js:625:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146766)
    at /packages/Hydrogen/node_modules/@nteract/markdown/lib/index.js:6:43)
    at /packages/Hydrogen/node_modules/@nteract/markdown/lib/index.js:11:3)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147450)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150998)
    at Module.load (internal/modules/cjs/loader.js:701:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:633:12)
    at Function.Module._load (internal/modules/cjs/loader.js:625:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146766)
    at /packages/Hydrogen/node_modules/@nteract/outputs/lib/components/media/markdown.js:13:36)
    at /packages/Hydrogen/node_modules/@nteract/outputs/lib/components/media/markdown.js:27:3)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147450)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:150998)
    at Module.load (internal/modules/cjs/loader.js:701:32)

Commands

Non-Core Packages

atom-file-icons 0.7.1 
atom-language-r 1.4.8 
autocomplete-python 1.16.0 
busy-signal 2.0.1 
git-plus 8.7.1 
git-time-machine 2.1.0 
Hydrogen 2.14.1 
intentions 1.1.5 
kite 0.184.0 
language-fortran 2.1.10 
language-latex 1.2.0 
language-matlab 0.2.1 
language-tcl 0.1.2 
latex 0.50.2 
linter 2.3.1 
linter-flake8 2.4.0 
linter-ui-default 1.8.1 
minimap 4.29.9 
multi-cursor 3.0.0 
script 3.26.0 
split-diff 1.6.1 
teletype 0.13.4 

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 24 (3 by maintainers)

Most upvoted comments

Solution to these issues. Enjoy your Hydrogen!

https://github.com/tomato-300yen/mathjax_lib_for_hydrogen

Same issue repeated on 2.14.3 version. Can’t found another file ~\.atom\packages\Hydrogen\node_modules@nteract\markdown\lib\index.js

I solved my issue by:

  • Copying and pasting the lib folder and the .json files that Hydrogen was asking for

https://github.com/tomato-300yen/mathjax_lib_for_hydrogen

  • And most important, I used the Hydrogen version 2.9.0 by:

apm install hydrogen@2.9.0 [command prompt]

See also gh-1944, gh-1946.

I had the same problem with a fresh install on my new desktop. I have a working installation on my laptop, with identical package specification to that on the desktop, checked via diff of atom list, and the same Atom version, checked with atom --version.

I can confirm that the folder packages/Hydrogen/node_modules/@nteract/mathjax/lib is missing in my desktop installation. Copying the lib folder from the laptop, to the same location on the desktop, fixed the problem.

Hello everyone! This issue originally occurred because the @nteract/mathjax package was shipped with some missing assets. The issue was resolved in a prior release so this should no longer be a problem.

I’ll close this issue for now but please re-open if it happens again.

I dont think the issue should be closed - the goal must be that a Hydrogen install should work correctly without these fixes.

Given that the installation of the same exact version of Hydrogen worked correctly a few weeks ago, on the same Atom version and OS, I wonder whether this could be some interaction with the Atom install machinery.

Yep perfect. All problems on my end solved with the ansi_to_react lib folder also being included. Thanks @tomato-300yen!

I verymuch think this issue should be pinned and closed, as this thread contains a solution to the problem, and this problem seems quite common

Thank you very much for the solution! It saved my day!

Same issue here. I wanted to install hydrogen today, but I didn’t work on Mac OS as well as Linux. I looked into the package folder “packages/Hydrogen/node_modules/@nteract/mathjax/”. There the ‘lib’ folder doesn’t exist in that directory.