Uncaught Error: No project root found
[Enter steps to reproduce:]
- ...
- ...
Atom: 1.15.0 x64 Electron: 1.3.13 OS: Mac OS X 10.12.4 Thrown From: atom-import-js package 0.6.1
Stack Trace
Uncaught Error: No project root found
At /Users/davidmbrowning/.atom/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:20
Error: No project root found
at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:20:11)
at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:28:10)
at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:28:10)
at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:28:10)
at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:28:10)
at findProjectRoot (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:39:10)
at withModuleFinder (/packages/atom-import-js/lib/withModuleFinder.js:6:26)
at fixImports (/packages/atom-import-js/lib/import-js.js:120:3)
at /packages/atom-import-js/lib/import-js.js:152:38)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
at CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:3:59)
at CommandRegistry.module.exports.CommandRegistry.dispatch (/app.asar/src/command-registry.js:160:19)
at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (/app.asar/src/atom-environment.js:1168:28)
at EventEmitter.outerCallback (/app.asar/src/application-delegate.js:325:25)
at emitThree (events.js:116:13)
at EventEmitter.emit (events.js:194:7)
Commands
-1:15 line-ending-selector:show (atom-text-editor.editor.is-focused)
-0:49.5.0 tree-view:show-current-file-in-file-manager (li.texteditor.tab.sortable.active.right-clicked)
-0:31.3.0 deprecation-cop:view (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-dark-syntax.theme-one-dark-ui)
-0:15.3.0 js-console:toggle (span.syntax--punctuation.syntax--definition.syntax--string.syntax--begin.syntax--json)
-0:01.8.0 import-js:fix-imports (div.scrollbar-content)
Non-Core Packages
ariake-dark-syntax 0.1.3
atom-agressive-js-iterable 0.1.1
atom-atomist-js 0.4.6
atom-formatter-jsbeautify 1.1.2
atom-import-js 0.6.1
atom-js-console 1.2.2
atom-js-import 0.2.0
atom-json-color 0.6.0
atom-json-editor 0.4.1
atom-material-syntax 1.0.2
atom-material-ui 1.3.9
atom-minify-stand-alone 0.2.0
autocomplete-cocos2d-js 0.7.0
autocomplete-js-import 1.4.0
autocomplete-json 5.4.0
best-js-snippets 4.1.0
busy-signal 1.3.0
coffee-paste 0.8.0
colorful-json 1.1.0
declarations 1.1.3
declarations-js 1.0.2
flatten-json 0.1.5
formatter-json 1.0.1
Hydrogen 1.10.1
hydrogen-launcher 1.2.0
intentions 1.1.2
js-extractor 0.0.2
js-extras 1.9.0
js-hyperclick 1.10.1
js-refactor 0.7.5
json-colorer 1.0.0
json-converter 0.2.4
json-schema 0.1.15
jsonpp 0.1.1
jupyter-notebook 0.0.9
language-cfml 0.17.0
language-dot-js 0.1.0
language-js-inline-hbs 0.8.0
language-js-specs 0.1.0
language-markdown-in-js 1.0.2
linter 2.1.2
linter-autocomplete-jing 0.7.2
linter-cflint 0.14.0
linter-js-cloudformation-yaml 2.2.1
linter-js-standard-engine 2.0.0
linter-js-yaml 1.2.7
linter-json-lint 0.1.1
linter-ui-default 1.2.2
my-package 0.0.0
pp-js 0.0.2
pretty-json 1.6.3
Thanks for reporting your issue. Can you tell me a little about the file structure for the project you're trying to run import-js in? I'm asking because that error is thrown when import-js, based on the currently opened file, tries to find a "project root" - a place in the directory structure where there is a package.json and a node_modules folder. Here's the relevant code: https://github.com/Galooshi/import-js/blob/a4a284ba5ab710f5fa7eca5b9425214d2d3f813a/lib/findProjectRoot.js#L6
We should probably make that error message clearer and more actionable for folks! 🍡