TypeStrong / atom-typescript

The only TypeScript package you will ever need
https://atom.io/packages/atom-typescript
MIT License
1.13k stars 205 forks source link

Failed to load the atom-typescript package: cannot read property 'React' of undefined #533

Closed aggieben closed 8 years ago

aggieben commented 9 years ago
C:\Users\Benjamin\Projects\project [master]> apm list
Built-in Atom packages (89)
├── about@1.0.1
├── archive-view@0.58.0
├── atom-dark-syntax@0.27.0
├── atom-dark-ui@0.50.0
├── atom-light-syntax@0.28.0
├── atom-light-ui@0.43.0
├── autocomplete-atom-api@0.9.2
├── autocomplete-css@0.10.1
├── autocomplete-html@0.7.2
├── autocomplete-plus@2.19.0
├── autocomplete-snippets@1.7.1
├── autoflow@0.25.0
├── autosave@0.22.0
├── background-tips@0.26.0
├── base16-tomorrow-dark-theme@0.26.0
├── base16-tomorrow-light-theme@0.9.0
├── bookmarks@0.36.0
├── bracket-matcher@0.76.0
├── command-palette@0.36.0
├── deprecation-cop@0.54.0
├── dev-live-reload@0.46.0
├── encoding-selector@0.21.0
├── exception-reporting@0.36.0
├── find-and-replace@0.180.0
├── fuzzy-finder@0.87.0
├── git-diff@0.55.0
├── go-to-line@0.30.0
├── grammar-selector@0.47.0
├── image-view@0.54.0
├── incompatible-packages@0.24.1
├── keybinding-resolver@0.33.0
├── language-c@0.47.0
├── language-clojure@0.16.0
├── language-coffee-script@0.41.0
├── language-csharp@0.7.0
├── language-css@0.33.0
├── language-gfm@0.80.0
├── language-git@0.10.0
├── language-go@0.37.0
├── language-html@0.40.1
├── language-hyperlink@0.14.0
├── language-java@0.16.0
├── language-javascript@0.87.1
├── language-json@0.16.0
├── language-less@0.28.2
├── language-make@0.16.0
├── language-mustache@0.12.0
├── language-objective-c@0.15.0
├── language-perl@0.28.0
├── language-php@0.29.0
├── language-property-list@0.8.0
├── language-python@0.38.0
├── language-ruby@0.57.0
├── language-ruby-on-rails@0.22.0
├── language-sass@0.40.1
├── language-shellscript@0.15.0
├── language-source@0.9.0
├── language-sql@0.17.0
├── language-text@0.7.0
├── language-todo@0.26.0
├── language-toml@0.16.0
├── language-xml@0.32.0
├── language-yaml@0.24.0
├── link@0.30.0
├── markdown-preview@0.150.0
├── metrics@0.51.0
├── notifications@0.57.0
├── one-dark-syntax@1.1.0
├── one-dark-ui@1.0.3
├── one-light-syntax@1.1.0
├── one-light-ui@1.0.3
├── open-on-github@0.38.0
├── package-generator@0.40.0
├── release-notes@0.53.0
├── settings-view@0.213.0
├── snippets@0.95.0
├── solarized-dark-syntax@0.38.1
├── solarized-light-syntax@0.22.1
├── spell-check@0.59.0
├── status-bar@0.75.1
├── styleguide@0.44.0
├── symbols-view@0.100.0
├── tabs@0.82.0
├── timecop@0.31.0
├── tree-view@0.183.0
├── update-package-dependencies@0.10.0
├── welcome@0.30.0
├── whitespace@0.30.0
└── wrap-guide@0.35.0

C:\Users\Benjamin\.atom\packages (30)
├── .bin
├── advanced-new-file@0.4.3
├── angularjs@0.3.0
├── atom-beautify@0.28.11
├── atom-html-preview@0.1.11
├── atom-runner@2.4.1
├── atom-typescript@5.4.0
├── atom-yeoman@0.3.12
├── atomic-emacs@0.7.2
├── git-plus@5.4.4
├── gruvbox@1.0.5
├── json-schema@0.1.11
├── language-clojure@0.16.0
├── language-csharp@0.7.0
├── language-cshtml@0.1.1
├── language-fsharp@0.8.4
├── language-ini@1.11.0
├── language-javascript-jsx@0.3.7
├── language-powershell@2.0.1
├── line-ending-converter@1.3.2
├── linter@1.4.3
├── linter-clojure@0.0.5
├── linter-eslint@3.0.2
├── markdown-writer@1.8.1
├── merge-conflicts@1.3.5
├── minimap@4.12.3
├── node-debugger
├── omnisharp-atom@0.23.2
├── react@0.12.6
└── script@2.26.4

image

basarat commented 9 years ago

Some people seem to get it ... others don't. Can you do me a favor and paste here the contents of C:\Users\Benjamin\.atom\package\atom-typescript\package.json as well as C:\Users\Benjamin\.atom\package\atom-typescript\node_modules\ntypescript\package.json.

Hope you don't have a custom compiler configured? < If you don't know what that means ... its means the answer is no :rose:

domesticmouse commented 9 years ago

I'm seeing this too. Firstly, the .../atom-typescript/package.json file:

~/.a/p/atom-typescript> cat package.json
{
  "name": "atom-typescript",
  "version": "6.0.0",
  "main": "./dist/main/atomts",
  "bin": {
    "atbuild": "./dist/main/bin/atbuild"
  },
  "preferGlobal": "true",
  "description": "The only TypeScript plugin you will ever need.",
  "engines": {
    "atom": ">=0.199.0 <2.0.0",
    "node": "*"
  },
  "providedServices": {
    "autocomplete.provider": {
      "versions": {
        "2.0.0": "provide"
      }
    },
    "linter": {
      "versions": {
        "1.0.0": "provideLinter"
      }
    }
  },
  "consumedServices": {
    "snippets": {
      "versions": {
        "0.1.0": "consumeSnippets"
      }
    }
  },
  "homepage": "http://atom.io/packages/atom-typescript",
  "repository": {
    "type": "git",
    "url": "https://github.com/TypeStrong/atom-typescript.git"
  },
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/TypeStrong/atom-typescript/issues"
  },
  "dependencies": {
    "atom-package-dependencies": "https://github.com/basarat/atom-package-dependencies/archive/cb2.tar.gz",
    "atom-space-pen-views": "^2.0.4",
    "babel": "^5.6.23",
    "basarat-text-buffer": "6.0.0",
    "d3": "^3.5.5",
    "emissary": "^1.3.3",
    "escape-html": "^1.0.1",
    "fuzzaldrin": "^2.1.0",
    "glob-expand": "0.0.2",
    "htmltojsx": "0.2.4",
    "immutable": "^3.7.3",
    "json2dts": "0.0.1",
    "mkdirp": "^0.5.0",
    "ntypescript": "1.201508230720.1",
    "react": "^0.13.3",
    "season": "^5.1.4",
    "strip-bom": "^2.0.0"
  },
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-ts": "^3.0.0"
  },
  "package-dependencies": {
    "linter": "//this field will be ignored right now"
  },
  "keywords": [
    "typescript",
    "javascript",
    "html"
  ],
  "readme": "# Atom TypeScript\n\n[![Join the chat at https://gitter.im/TypeStrong/atom-typescript](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/TypeStrong/atom-typescript?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\nJavaScript developers can now just open a `.ts` file and start hacking away like they are used to. No `grunt` no `Visual Studio`. Just pure coding.\n\n## Installation\n\n1. Install [atom](https://atom.io).\n2. `apm install atom-typescript` (`apm` needs `git` in your path)\n3. Fire up atom. Wait for the message: `AtomTS: Dependencies installed correctly. Enjoy TypeScript ♥` **It may take up to 5 minutes for this message to appear. Be patient!**\n\n**Additional Notes**: [Some packages we love](https://github.com/TypeStrong/atom-typescript/blob/master/docs/packages.md).\n\n## Reviews\n*Featured on the TypeScript home page under tools http://www.typescriptlang.org/* and [demoed by **Anders Hejlsberg**](https://twitter.com/schwarty/status/593858817894404096).\n\n\"I was shocked at how good it felt to poke around on the compiler with it.\" [Jonathan Turner](https://twitter.com/jntrnr)  \n\"And guess what, it worked perfectly. Like everything else! Faster than Visual Studio!\" [Daniel Earwicker](http://stackoverflow.com/users/27423/daniel-earwicker)  \n\"It's a thing of beauty - they had me at '*Type information on hover*'. Discovering  `tsconfig.json` support as well was just an enormous bonus.\" [John Reilly](https://twitter.com/johnny_reilly)  \n\"This may be your best option for editing TypeScript at the moment - very nice!\" [Rasmus Schultz](https://twitter.com/mindplaydk)\n\n[*Add yours!*](https://github.com/TypeStrong/atom-typescript/issues/66)\n\n# Features\n* Autocomplete\n* Live error analysis\n* Type information on hover\n* Compile on save\n* Project Context Support (`tsconfig.json`)\n* Project Build Support\n* `package.json` Support\n* React Support\n* Format code\n* Goto Declaration\n* Find References\n* Block comment and uncomment\n* Goto history (goto next/previous error in open files, goto next/previous build)\n* Auto indent for new lines\n* TypeScript context menu\n* Symbols in Project\n* Symbols in File\n* Semantic View\n* Rename refactoring\n* Quick Fix\n* Toggle Breakpoint\n* Common Snippets\n* `import` / `/// <reference` relative path resolution\n* Output Toggle\n* AST visualizer\n* Dependency View\n* Sync\n\n# FAQ\nLocated online : https://github.com/TypeStrong/atom-typescript/blob/master/docs/faq.md\n\n----\n\n# Feature Details\n## Auto Complete\nInternally using AutoComplete+. Just start typing and hints will show up. Or you can explicitly trigger it using `ctrl+space` or `cmd+space`. Press `tab` to make a selection.\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/fastErrorCheckingAndAutoComplete2.gif)\n\n\n## Type information on hover\nJust hover\n\n![you definitely get the point](https://raw.githubusercontent.com/TypeStrong/atom-typescript/master/docs/screens/hover.png)\n\n## Compile on save\nTypeScript files will be compiled on save. Different notifications are given if `emit` was successful or not. [Configuration driven by `tsconfig.json`](https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md)\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript/master/docs/screens/compile%20success.png)\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript/master/docs/screens/compile%20error.png)\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript/master/docs/screens/emit%20error.png)\n\n## Project Support\nSupported via `tsconfig.json` ([read more](https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md)) which is going to be the defacto Project file format for the next versions of TypeScript.\n\nIt also supports `filesGlob` which will expand `files` for you based on `minmatch|glob|regex` (similar to grunt).\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript/master/docs/screens/proj.png)\n\n### Project Build Support\nShortcut: `F6`. If there are any errors they are shown as well.\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript/master/docs/screens/build%20success.png)\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript/master/docs/screens/build%20errors.png)\n\n## `package.json` Support\nWhere a sample `package.json` (anywhere next to or above a `tsconfig.json`) looks like:\n```json\n{\n    \"name\": \"awesome\",\n    \"main\": \"./dist/foo.js\",\n    \"typescript\": {\n        \"definition\": \"awesome.d.ts\"\n    }\n}\n```\n\nWe would generate a `awesome.d.ts` file for you *on build* so that other TypeScript projects can do a simple `require('awesome')`.\n\nWe have a sample NPM module : https://github.com/basarat/ts-npm-module and its usage is demoed in https://github.com/basarat/ts-npm-module-consume.\n\nNotes:\n* Relative paths in `definition` are not supported. This is due to a limitation in how the TypeScript compiler does file lookup.\n* Other people will be able to do `require('awesome')` only if their IDE supports looking at `node_modules` like we do. Otherwise they can always explicitly `/// <reference` your `awesome.d.ts` that we generate to get the same effect.\n\n## React Support\n\n### Configuration tips\n\nCovered here : http://basarat.gitbooks.io/typescript/content/docs/jsx/tsx.html\n\n### Html to TSX\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/htmltotsx.gif)\n\n## Format Code\nShortcut : `ctrl+alt+l` or `cmd+alt+l`. Will format just the selection if you have something selected otherwise it will format the entire file.\n\n## Go to Declaration\nShortcut : `F12`. Will open the *first* declaration of the said item for now. (Note: some people call it Go to Definition)\n\n## Find References\nShortcut `shift+F12`. Also called *find usages*.\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/findReferences.png)\n\n## Block Comment and Uncomment\n`ctrl+/` or `cmd+/`. Does a block comment / uncomment of code.\n\n## Go to Next / Go to Previous\n`f8` and `shift+f8` respectively. This will go to next/previous *errors in open files* OR *build error* OR *references* based on which tab you have selected.\n\n## Context menu\nQuickly toggle the TypeScript panel OR select active TypeScript panel tab and other stuff using the context menu. `ctrl+;` or `cmd+;`.\n\n## Symbols View\nIntegrates with atom's symbols view (`ctrl+r` or `cmd+r`) to provide you with a list of searchable symbols in the current file.\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/symbolsView.gif)\n\n## Semantic View\nA bird's eye view of the current file. Use command `toggle semantic view`. The view updates while you edit the code. You can also click to jump to any portion of the file.\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/semanticView.png)\n\n## Project Symbols View\nAlso called Go To Type in other IDEs. Integrates with atom's project level symbols (`ctrl+shift+r` or `cmd+shift+r`) to provide you with a list of searchable symbols in the *entire typescript project*.\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/projectSymbolView.png)\n\n## Refactoring\n\n### Rename\n`f2` to initiate rename. `enter` to commit and `esc` to cancel.\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript/master/docs/screens/renameRefactoring.png)\n\n## Quick Fix\nPress the `TypeScript: Quick Fix` shortcut `alt+enter` at an error location to trigger quick fixes. Select the quick fix you want and press `enter` to commit e.g\n\n### Add class members\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/addClassMember.gif)\n\n### More Quick fixes\nWe are actively adding quick fixes so [**go here for an up to date list**](https://github.com/TypeStrong/atom-typescript/blob/master/docs/quickfix.md).\n\n## Toggle Breakpoint\nUse command `TypeScript: Toggle Breakpoint` shortcut `f9`:\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/toggleBreakpoint.gif)\n\n## tsconfig validation\nWe will validate it and help you to fix it :)\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/errorcases/invalidProjectOptions/invalidProjectOptions.gif)\n\n## Snippets\n### Relative Paths\nRelative paths have traditionally been a pain, not anymore. Use `import` or `ref` and press `tab` to trigger snippet.\n\n`ref`\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/ref%20snippet.gif)\n\n`import`\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/import%20snippet.gif)\n\nNote that within the path string you get autocomplete (`ctrl+space`/`cmd+space`) for all the files in the project by filename (works for both `ref` and `import`).\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/pathChange.gif)\n\n## Output Toggle\n`ctrl+shift+m` to toggle the output co**m**piled JS file for a give TypeScript file. The keyboard shortcut is consistent with atom's markdown preview.\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/outputToggle.gif)\n\n## AST Visualizer\nCommand : `Typescript: Ast`. Useful when authoring new features.\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/astVisualizer.gif)\n\nAlso command : `TypeScript: Ast Full` that includes the `trivia` (punctuation, comments etc. received from `ts.Node.getChildren()`) as well.\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/astFull.png)\n\n## Dependency View\nCommand : `Typescript: Dependency View`. A dependency viewer for insight into the project if you use external modules. You can zoom, pan, drag points around and hover over nodes. ([more details](https://github.com/TypeStrong/atom-typescript/blob/master/docs/dependency-view.md))\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/dependencyView/teaser.png)\n\n## Sync\nWe try to keep as much of the stuff in sync while you edit code. However *in dire circumstances*:\n\n* a soft sync is done when you save a file `ctrl+s` and we will completely reprocess the *active* file. This might not fix stuff if the error is because of *some other file on the file system*.\n* `ctrl+'` or `cmd+'` : If you deleted files in the background or renamed them or jumped git branches or *something weird just happened* then sync. No need to restart your IDE :).\n\n![](https://raw.githubusercontent.com/TypeStrong/atom-typescript-examples/master/screens/sync.gif)\n\n## Contributing\n\nLook at [CONTRIBUTING.md](https://github.com/TypeStrong/atom-typescript/blob/master/CONTRIBUTING.md) for curiosity. We work hard to keep the code as approachable as possible and are highly keen on helping you help us.\n\n## Changelog\nBreaking changes [available online](https://github.com/TypeStrong/atom-typescript/blob/master/docs/CHANGELOG.md).\n\n## Donating\nSupport this project and [others by basarat][gratipay-basarat] via [gratipay][gratipay-basarat].\n\n[![Support via Gratipay][gratipay]][gratipay-basarat]\n\n[gratipay]: https://cdn.rawgit.com/gratipay/gratipay-badge/2.3.0/dist/gratipay.png\n[gratipay-basarat]: https://gratipay.com/basarat/\n",
  "readmeFilename": "README.md",
  "_id": "atom-typescript@6.0.0",
  "_shasum": "8a5288277d34aef16df2ca815c3e8ca0160dd7a6",
  "_resolved": "file:../d-115728-51185-1bwo2x/package.tgz",
  "_from": "../d-115728-51185-1bwo2x/package.tgz"
}

And the .../ntypescript/package.json file:

~/.a/p/a/n/ntypescript> cat package.json
{
  "name": "ntypescript",
  "version": "1.201508230720.1",
  "description": "A naughty version of microsoft/typescript packaged and released",
  "main": "./bin/ntypescript.js",
  "bin": {
    "ntsc": "./bin/tsc",
    "ntse": "./bin/tse"
  },
  "typescript": {
    "definition": "./bin/ntypescript.d.ts"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/basarat/ntypescript.git"
  },
  "keywords": [
    "typescript",
    "gruntplugin"
  ],
  "author": {
    "name": "basaratali@gmail.com"
  },
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/basarat/ntypescript/issues"
  },
  "homepage": "https://github.com/basarat/ntypescript#readme",
  "devDependencies": {
    "grunt": "^0.4.5"
  },
  "gitHead": "68af4be10ac3f09385ed89515997e5596336657a",
  "_id": "ntypescript@1.201508230720.1",
  "scripts": {},
  "_shasum": "9d3f74d0a5234deea672f4acee6262cd7259f3e2",
  "_from": "ntypescript@1.201508230720.1",
  "_npmVersion": "2.13.3",
  "_nodeVersion": "3.1.0",
  "_npmUser": {
    "name": "basarat",
    "email": "basaratali@gmail.com"
  },
  "dist": {
    "shasum": "9d3f74d0a5234deea672f4acee6262cd7259f3e2",
    "tarball": "http://registry.npmjs.org/ntypescript/-/ntypescript-1.201508230720.1.tgz"
  },
  "maintainers": [
    {
      "name": "basarat",
      "email": "basaratali@gmail.com"
    },
    {
      "name": "nycdotnet",
      "email": "steve.ognibene@outlook.com"
    }
  ],
  "directories": {},
  "_resolved": "https://registry.npmjs.org/ntypescript/-/ntypescript-1.201508230720.1.tgz"
}
basarat commented 9 years ago

I'm seeing this too.

Your ntypescript version matches what atom-typescript requires ... so I guess the install ran successfully. Don't know what's causing this though. And I don't have any other ideas

halhenke commented 9 years ago

I'm getting a similar issue that Atom is telling me has already been reported and links here. But in this case its compaining about 'atom-package-dependencies' and not React:

Failed to load the atom-typescript package
Cannot find module 'atom-package-dependencies'
Hide Stack Trace
Error: Cannot find module 'atom-package-dependencies'
    at Module._resolveFilename (module.js:328:15)
    at Function.Module._resolveFilename (/Applications/Atom.app/Contents/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> (/Users/hal/.atom/packages/atom-typescript/dist/main/atomts.js:6:11)
    at Module._compile (module.js:452:26)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:169:21)
    at Module.load (module.js:347:32)
    at Function.Module._load (module.js:302:12)
basarat commented 9 years ago

But in this case its compaining about 'atom-package-dependencies' and not React

@halhenke This has been fixed in the latest (about a week ago?). Please update.

If issue persists please post the version number :rose:

MachineMakesNoise commented 9 years ago

Getting the same error, only the module missing is "ntypescript". Version is 6.0.13, and this is a clean install as atom-typescript is the only plugin (and .bin project atom-typescript seems to want) that has been installed.

jcaramello commented 9 years ago

I Also getting the same error. Thanks, Regards

Cannot find module 'ntypescript'
Hide Stack Trace
Error: Cannot find module 'ntypescript'
  at Module._resolveFilename (module.js:334:15)
  at Function.Module._resolveFilename (C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\module-cache.js:383:52)
  at Function.Module._load (module.js:284:25)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Object.makeTsGlobal (C:\Users\José\.atom\packages\atom-typescript\dist\typescript\makeTypeScriptGlobal.js:20:22)
  at Object.<anonymous> (C:\Users\José\.atom\packages\atom-typescript\dist\main\atomts.js:3:24)
  at Module._compile (module.js:428:26)
  at Object.defineProperty.value [as .js] (C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\compile-cache.js:169:21)
  at Module.load (module.js:353:32)
  at Function.Module._load (module.js:308:12)
  at Module.require (module.js:363:17)
  at require (module.js:382:17)
  at Package.module.exports.Package.requireMainModule (C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\package.js:761:34)
  at C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\package.js:192:28
  at Package.module.exports.Package.measure (C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\package.js:169:15)
  at Package.module.exports.Package.load (C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\package.js:183:12)
  at PackageManager.module.exports.PackageManager.loadPackage (C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\package-manager.js:405:14)
  at PackageManager.module.exports.PackageManager.activatePackage (C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\package-manager.js:485:30)
  at C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\node_modules\settings-view\lib\package-manager.js:371:29
  at exit (C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\node_modules\settings-view\lib\package-manager.js:60:16)
  at triggerExitCallback (C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\buffered-process.js:213:47)
  at C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\buffered-process.js:220:18
  at Socket.<anonymous> (C:\Users\José\AppData\Local\atom\app-1.0.15\resources\app.asar\src\buffered-process.js:98:18)
  at emitOne (events.js:82:20)
  at Socket.emit (events.js:169:7)
  at Pipe._onclose (net.js:467:12)
basarat commented 9 years ago

Cannot find module 'ntypescript'

Seems like a bad install. Try reinstalling : https://github.com/TypeStrong/atom-typescript/blob/master/docs/faq.md#failed-to-update

MachineMakesNoise commented 9 years ago

@basarat nope, unfortunately that's not it. Tried to uninstall and reinstall of the plugin and it didn't help. Tried reinstalling atom too but no help, still same error.

I'm using Win10 if that helps.

basarat commented 9 years ago

Tried reinstalling atom too but no help, still same error

@saviilsy @jcaramello Is ntypescript there in atom-typescript/node_modules?

MachineMakesNoise commented 9 years ago

@basarat Yes, and install does not yield any errors/warnings.

basarat commented 9 years ago

Looking at the call stack (https://github.com/TypeStrong/atom-typescript/issues/533#issuecomment-141966709)

C:\Users\José.atom\packages\atom-typescript\dist\typescript\makeTypeScriptGlobal.js

I see no reason why require('ntypescript') would have if you have ntypescript installed. https://github.com/TypeStrong/atom-typescript/blob/90b0081c4a9b332d0950b1724e221f6b56181723/dist/typescript/makeTypeScriptGlobal.js#L20

Seems like a bug in atom. A repro would be appreciated, or someone with the error can look at it more

jcaramello commented 9 years ago

Hi,

I think that the error is caused for some bug in apm, because I installed globally the ntypescript module using npm, and it's still fail, but when I change the makeTypeScriptGlobal.js, in order to point with an absolute reference,the module, it work. (But fail with other module like isUtf8), So, I decided to go back to a previuos version of atom.

I uninstalled atom, and removed manually the folder .atom, located in my user folder, and then I installed a previous version of atom, https://github.com/atom/atom/releases/tag/v1.0.10, (I downloaded the zip version, because the installer update to the latest version after install) and then I installed the plugin and it's work fine.

Thanks, Regards!!

MachineMakesNoise commented 9 years ago

@jcaramello thanks for the tip, I'll try that as well.

I did some research on this issue as well and I too concluded that it is either underlying io.js or apm (who ever controls how require behave). All those modules that fail to load don't have index.js on their module root. It seems that require ignores package.json "main" property when resolving module entry point. If you manually add it to module it starts to work (You don't want to do this, it takes a lot work to add it to all dependancies, downgrading like @jcaramello seems to be the best solution until this is fixed).

I replied my findings to Atom issue : https://github.com/atom/atom/issues/8891

delebash commented 9 years ago

Windows 10 x64

The 1.1.0 beta1 prerelease fixed this problem for me

Jonatthu commented 8 years ago

VERSION 8 [Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.3.3 System: Unknown Windows Version Thrown From: atom-typescript package, v8.0.0

Stack Trace

Failed to load the atom-typescript package

At Cannot find module 'ntypescript'

Error: Cannot find module 'ntypescript'
    at Module._resolveFilename (module.js:336:15)
    at Function.Module._resolveFilename (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\module-cache.js:383:52)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\native-compile-cache.js:50:27)
    at Object.makeTsGlobal (C:\Users\Jonathan\.atom\packages\atom-typescript\dist\typescript\makeTypeScriptGlobal.js:21:22)
    at Object.<anonymous> (C:\Users\Jonathan\.atom\packages\atom-typescript\dist\main\atomts.js:4:24)
    at Module._compile (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\native-compile-cache.js:50:27)
    at Package.module.exports.Package.requireMainModule (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\package.js:663:34)
    at C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\package.js:115:28
    at Package.module.exports.Package.measure (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\package.js:92:15)
    at Package.module.exports.Package.load (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\package.js:106:12)
    at PackageManager.module.exports.PackageManager.loadPackage (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\package-manager.js:438:14)
    at PackageManager.module.exports.PackageManager.loadPackages (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\package-manager.js:390:14)
    at AtomEnvironment.module.exports.AtomEnvironment.startEditorWindow (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\atom-environment.js:682:21)
    at module.exports (C:\Users\Jonathan\AppData\Local\atom\app-1.3.3\resources\app.asar\src\initialize-application-window.js:28:10)
    at setupWindow (file:///C:/Users/Jonathan/AppData/Local/atom/app-1.3.3/resources/app.asar/static/index.js:86:5)
    at window.onload (file:///C:/Users/Jonathan/AppData/Local/atom/app-1.3.3/resources/app.asar/static/index.js:41:9)

Commands

Config

{
  "core": {
    "themes": [
      "atom-material-ui",
      "atom-material-syntax"
    ],
    "autoHideMenuBar": true,
    "excludeVcsIgnoredPaths": false
  },
  "atom-typescript": {}
}

Installed Packages

# User
.bin, vundefined
altgr, v0.1.0
atom-material-syntax, v0.2.10
atom-material-ui, v0.8.0
autoclose-html, v0.19.0
autosave-plus, v0.5.2
color-picker, v2.0.14
hide-files, v0.1.7
keyboard-localization, v1.4.13
language-javascript-jsx, v0.3.7
linter, v1.11.3
minimap, v4.19.0
open_in_cmd, v0.6.0
react-es6-snippets, v0.3.0
react-snippets, v0.3.0
seti-icons, v0.4.5
sublime-panes, v0.2.5
tool-bar, v0.1.10
tool-bar-main, v0.0.8

# Dev
No dev packages
basarat commented 8 years ago

Cannot find module 'ntypescript'

A tell tale sign of an atom-ts install gone bad. https://github.com/TypeStrong/atom-typescript/blob/master/docs/faq.md#failed-to-update :rose:

Since there have been sufficient and diverse reports on this I suspect its a common atom installation issue hence closing as it doesn't belong here :rose: