Failed to load the atom-typescript package
[Enter steps to reproduce below:]
- ...
- ...
Atom Version: 1.0.4 System: Unknown Windows Version Thrown From: atom-typescript package, v5.2.4
Stack Trace
Failed to load the atom-typescript package
At Cannot find module 'jsdom'
Error: Cannot find module 'jsdom'
at Module._resolveFilename (module.js:328:15)
at Function.Module._resolveFilename (C:\Users\a2132_000\AppData\Local\atom\app-1.0.4\resources\app.asar\src\module-cache.js:383:52)
at Function.Module._load (module.js:270:25)
at Module.require (module.js:357:17)
at require (module.js:376:17)
at Object.<anonymous> (C:\Users\a2132_000\.atom\packages\atom-typescript\node_modules\htmltojsx\src\htmltojsx.js:148:15)
at Module._compile (module.js:452:26)
at Object.loadFile [as .js] (C:\Users\a2132_000\AppData\Local\atom\app-1.0.4\resources\app.asar\src\babel.js:163:21)
at Module.load (module.js:347:32)
at Function.Module._load (module.js:302:12)
Commands
Config
{
"core": {
"projectHome": "D:\\work\\"
}
}
Installed Packages
# User
.bin, vundefined
angularjs, v0.3.0
angularjs-snippets, v0.10.18
atom-typescript, v5.2.4
editorconfig, v1.0.1
javascript-snippets, v1.0.0
minimap, v4.12.1
run-in-browser, v0.1.3
# Dev
No dev packages
I couldn't install it either.
Same here
+1
+1
+1
+1
Easy to fix: Just navigate to where the atom-typescript package is installed and install the missing module. npm install --save-dev jsdom
Restart atom and all is well :)
worked for me!
@cstefan How to find out where the atom-typescript package is installed?
@akalcik on which system did you install atom?
in windows go to
%appdata%
there you find .atom and in there a directory called packages there is the plugin installed
@wmalgadey Good question, sorry. Yes I'm on Windows. The %appdata% points to the Roaming profile, there isn't package folder under the atom folder. I went to Local folder under the AppData. There are only three files atom-1.0.4-delta.nupkg,atom-1.0.4-full.nupkg and RELEASES. If I install the jsdom here, new folder is created, but I get the error again.

+1
@akalcik I found it here:
C:\Users[user].atom\packages\atom-typescript
thanks @cstefan. worked for me
FWIW we don't have any calls to require('jsdom') so some package that we are depending on uses it ... but doesn't have it in in package.json.
Investigating
I've tracked it back to this line : https://github.com/reactjs/react-magic/blob/d85cf2665282b9b9d71f0ad4637d01deef448f37/src/htmltojsx.js#L148 But it doesn't actually have a depdency on it : https://github.com/reactjs/react-magic/blob/d85cf2665282b9b9d71f0ad4637d01deef448f37/package.json#L10
As a workaround I'll take an explicit dependency on it for now
This commit broke it : https://github.com/reactjs/react-magic/commit/064c1f20e9fe15d4ae65ed6091975aee3c02ce56
Published with 5.2.6 :rose:
Thanks for the quick fix, @basarat!
Sorry about that! In HTMLtoJSX I got a pull request to switch from jsdom to jsdom-no-contextify, but it looks like the require statement wasn't updated. Everything still worked when I was testing it, since I still had the old jsdom in my node_modules (I guess npm doesn't clean up unused modules). I'm still learning the ins and outs of npm :smile:. I'll fix this right now.
As an aside, I'd suggest adjusting your dependencies so you depend on particular versions of modules, rather than allowing any newer versions. Not using specific versions means that your builds are not repeatable, and you could potentially be using an untested combination of modules.
Pushed 0.2.4 of HTMLtoJSX to fix this. Thanks for reporting it!
+1