Giter Site home page Giter Site logo

atom-import-js's People

Contributors

lencioni avatar nene avatar nfarina avatar trotzig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

atom-import-js's Issues

Fixing imports with a selection and a non-selection import skips the non-selection import

If I have a file that has two imports that need to be added, one with multiple possibilities and the other with a single match, after selecting the import from the list only the selected import is added while the one with a single match is skipped. If there are multiple imports to be selected, things work as expected.

I believe this is because we are passing the --word flag if only one selection needed to be made.

Cmd-shift-J adds duplicate imports when they don't match settings exactly

I'm in Atom, with v0.3.0 of atom-import-js with the default settings (via no settings file). I'm able to get cmd-shift-J to reliably insert duplicate imports if the import that's already present either ends with a semicolon, or has the file extension in it.

I'm in a file like this, with a sibling file AppView.js which exports AppView:

import AppView from './AppView'

const Test = AppView;

If I cursor over AppView in line 3 and hit cmd-shift-J, I end up with this:

import AppView from './AppView';

import AppView from './AppView'

const Abc = AppView;

Same with importing from ./AppView.js. If I match the expectations from the default settings and provide import AppView from './AppView'; then it works correctly.

Imported custom types are removed erroneously

I have a custom type exported from another file and imported into a service. I set the types of certain variables and function returns in the service, however the "fix all imports" command still removes my imported types. My code is similar to the following:

import { MyType1, MyType2} from './custom-types';

...

getData = (): Observable<MyType1> => {
  let myVariable: MyType2;
...
}

And the import statement is removed despite the types being used in the rest of the code.

Uncaught Error: No project root found, looking for a directory with a package.json file.

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.46.0 x64
Electron: 4.2.7
OS: Microsoft Windows 10 Pro
Thrown From: atom-import-js package 1.0.0

Stack Trace

Uncaught Error: No project root found, looking for a directory with a package.json file.

At C:\Users\USER\.atom\packages\atom-import-js\node_modules\import-js\build\findProjectRoot.js:34

Error: No project root found, looking for a directory with a package.json file.
    at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:34:11)
    at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:45:10)
    at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:45:10)
    at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:45:10)
    at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:45:10)
    at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:45:10)
    at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:45:10)
    at findProjectRoot (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:57: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:155:38)
    at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:349538)
    at CommandRegistry.dispatch (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:11:348013)
    at AtomEnvironment.dispatchContextMenuCommand (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:1:752337)
    at EventEmitter.t (~/AppData/Local/atom/app-1.46.0/resources/app/static/<embedded>:1:760343)
    at EventEmitter.emit (events.js:182:13)

Commands

     -5:47.3.0 intentions:highlight (input.hidden-input)
     -5:47.2.0 core:save (input.hidden-input)
 27x -5:28.4.0 core:move-down (input.hidden-input)
 45x -5:25.9.0 core:move-up (input.hidden-input)
     -5:12.8.0 core:move-down (input.hidden-input)
 14x -5:12.4.0 core:move-up (input.hidden-input)
 35x -5:11.1.0 core:move-down (input.hidden-input)
     -5:07.7.0 intentions:highlight (input.hidden-input)
     -5:07.5.0 core:save (input.hidden-input)
     -4:57.7.0 tree-view:copy-full-path (li.file.entry.list-item.status-added.selected)
 28x -4:08.9.0 core:move-down (input.hidden-input)
 48x -3:58.4.0 core:move-up (input.hidden-input)
  3x -2:51.6.0 core:backspace (input.hidden-input)
     -2:47.4.0 intentions:highlight (input.hidden-input)
     -2:47.1.0 core:save (input.hidden-input)
     -0:08.6.0 import-js:fix-imports (span.syntax--source.syntax--js)

Non-Core Packages

atom-beautify 0.33.4 
atom-html-preview 0.2.6 
atom-import-js 1.0.0 
atom-js 1.2.0 
atom-js-console 1.2.2 
atom-ternjs 0.20.0 
autoclose-html 0.23.0 
busy-signal 2.0.1 
csslint 1.2.0 
emmet 2.4.3 
hyperclick 0.1.5 
intentions 1.1.5 
js-test-gen-atom 0.2.0 
language-ejs 0.4.0 
language-mozilla-test 1.2.0 
linter 2.3.1 
linter-eslint 8.5.5 
linter-jshint 3.1.19 
linter-ui-default 1.8.1 
pigments 0.40.2 
Sublime-Style-Column-Selection 1.7.5 

when importing, atom hangs

I updated some packages and reinstalled watchman.

now, when i try to import with cmd+shift+i, atom sometimes hang and has to be killed :-(

using latest version 0.11.0

Uncaught Error: No project root found

[Enter steps to reproduce:]

  1. ...
  2. ...

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 

Remove direct dependency on import-js

Instead of having a direct dependency on import-js in the Atom plugin, I think we should require import-js to be separately installed like we do for all other editor integrations. This will make things consistent, and work well with Galooshi/import-js#491

The VSCode plugin has some good integrations for auto installing import-js, which we might want to borrow from here.

Issue when trying to install atom-import-js

Hey I get this error when I try to install it on windows 10.
`Installing “[email protected]” failed.Hide output…

[email protected] install C:\Users\BENONY~1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3
node-pre-gyp install --fallback-to-build

Failed to execute 'C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\bin\node.exe C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\bin\..\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\BENONY1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3\lib\binding\electron-v1.6-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\BENONY1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3\lib\binding\electron-v1.6-win32-x64' (1)
C:\Users\BENONY~1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr
`-- (empty)

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/electron-v1.6-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (electron-v1.6 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack at C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR! stack at C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\bin\node.exe" "C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\BENONY1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3\lib\binding\electron-v1.6-win32-x64\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\Users\BENONY1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3\lib\binding\electron-v1.6-win32-x64"
gyp ERR! cwd C:\Users\BENONY1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\bin\node.exe C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\bin\..\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\BENONY
1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3\lib\binding\electron-v1.6-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\BENONY1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3\lib\binding\electron-v1.6-win32-x64' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\BENONY
1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 10.0.14393
node-pre-gyp ERR! command "C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\bin\node.exe" "C:\Users\BENONY1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\BENONY
1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\node_modules\atom-import-js\node_modules\sqlite3
node-pre-gyp ERR! node -v v6.9.5
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\BENONY1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\package.json'
npm WARN apm-install-dir-117107-6440-1akc8tq.1n10olmcxr No description
npm WARN apm-install-dir-117107-6440-1akc8tq.1n10olmcxr No repository field.
npm WARN apm-install-dir-117107-6440-1akc8tq.1n10olmcxr No README data
npm WARN apm-install-dir-117107-6440-1akc8tq.1n10olmcxr No license field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\bin\node.exe" "C:\Users\benonymus\AppData\Local\atom\app-1.21.2\resources\app\apm\node_modules\npm\bin\npm-cli.js" "--globalconfig" "C:\Users\benonymus\.atom\.apm\.apmrc" "--userconfig" "C:\Users\benonymus\.atom\.apmrc" "install" "C:\Users\BENONY
1\AppData\Local\Temp\d-117107-6440-wojvzz.as00r1wcdi\package.tgz" "--runtime=electron" "--target=1.6.15" "--arch=x64" "--global-style"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\BENONY~1\AppData\Local\Temp\apm-install-dir-117107-6440-1akc8tq.1n10olmcxr\npm-debug.log
npm ERR! code 1`

Fails to load because of incompatible native module: sqlite3

Atom-import-js used to work just fine, until one fine day it suddenly stopped working. Perhaps related to recent OSX update.

Got the following error in console:

Failed to require the main module of 'atom-import-js' because it requires one or more incompatible native modules (sqlite3).
Run apm rebuild in the package directory and restart Atom to resolve.

Tried running apm rebuild in the package directory... the rebuild went just fine. Even tried to completely uninstall and reinstall atom-import-js, but still doesn't work.

The sqlite3 command is available in OSX console and works without issues. I see that sqlite3 is a dependency of import-js itself and it's nicely installed inside node_modules/... I guess it contains native part that's causing this incompatibility...

What else could I look into?

Can't install atom-import-js (Python 3)

Hi, I'm trying to run apm install atom-import-js and got this error message:

> [email protected] install /private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

Failed to execute '/Applications/Atom.app/Contents/Resources/app/apm/bin/node /Applications/Atom.app/Contents/Resources/app/apm/bin/../node_modules/.bin/node-gyp configure --fallback-to-build --module=/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.7-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.7-darwin-x64 --node_abi_napi=electron-v1.7 --python=/Applications/Atom.app/Contents/Resources/app/apm/bin/python-interceptor.sh' (1)
/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29
└── (empty)


node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.0/electron-v1.7-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (electron-v1.7 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/Applications/Atom.app/Contents/Resources/app/apm/bin/python-interceptor.sh" is v3.6.3, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at failPythonVersion (/Applications/Atom.app/Contents/Resources/app/apm/node_modules/node-gyp/lib/configure.js:454:14)
gyp ERR! stack     at /Applications/Atom.app/Contents/Resources/app/apm/node_modules/node-gyp/lib/configure.js:443:9
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:197:7)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
gyp ERR! stack     at Socket.<anonymous> (internal/child_process.js:334:11)
gyp ERR! stack     at emitOne (events.js:96:13)
gyp ERR! stack     at Socket.emit (events.js:188:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:498:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/node-gyp" "configure" "--fallback-to-build" "--module=/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.7-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.7-darwin-x64" "--node_abi_napi=electron-v1.7" "--python=/Applications/Atom.app/Contents/Resources/app/apm/bin/python-interceptor.sh"
gyp ERR! cwd /private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Applications/Atom.app/Contents/Resources/app/apm/bin/node /Applications/Atom.app/Contents/Resources/app/apm/bin/../node_modules/.bin/node-gyp configure --fallback-to-build --module=/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.7-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.7-darwin-x64 --node_abi_napi=electron-v1.7 --python=/Applications/Atom.app/Contents/Resources/app/apm/bin/python-interceptor.sh' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Darwin 17.5.0
node-pre-gyp ERR! command "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/node_modules/atom-import-js/node_modules/sqlite3
node-pre-gyp ERR! node -v v6.9.5
node-pre-gyp ERR! node-pre-gyp -v v0.9.0
node-pre-gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/package.json'
npm WARN apm-install-dir-118518-94052-1h8wdjr.h9b3dte29 No description
npm WARN apm-install-dir-118518-94052-1h8wdjr.h9b3dte29 No repository field.
npm WARN apm-install-dir-118518-94052-1h8wdjr.h9b3dte29 No README data
npm WARN apm-install-dir-118518-94052-1h8wdjr.h9b3dte29 No license field.
npm ERR! Darwin 17.5.0
npm ERR! argv "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Users/kongpon-macbook/.atom/.apm/.apmrc" "--userconfig" "/Users/kongpon-macbook/.atom/.apmrc" "install" "/private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/d-118518-94052-9y7m93.eol28x5hfr/package.tgz" "--runtime=electron" "--target=1.7.15" "--arch=x64" "--global-style"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /private/var/folders/s5/8rx6q8sd1z14vv2nsh135pww0000gn/T/apm-install-dir-118518-94052-1h8wdjr.h9b3dte29/npm-debug.log
npm ERR! code 1

How could I fix it? I personally don't write python, but I have python2 and 3 installed in my mac using anaconda (however, I have no idea how to switch or even use it)

I tried searching for how to change python version (found source activate py27) but it doesn't seem to work.

can't import anything with 0.5.0

after upgrading to 0.5.0 I can't import anything anymore. I always receive "No JS module to import for ...."

I can't downgrade the package in atom, so i am a little bit lost now :-(

Osx cannot install package

Installing “[email protected]” failed.Hide output…

> [email protected] install /private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
  LIBTOOL-STATIC Release/sqlite3.a
Failed to execute '/Applications/Atom.app/Contents/Resources/app/apm/bin/node /Applications/Atom.app/Contents/Resources/app/apm/bin/../node_modules/.bin/node-gyp build --fallback-to-build --module=/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64' (1)
/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor
`-- (empty)


node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/electron-v1.3-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (electron-v1.3 ABI) (falling back to source compile with node-gyp) 
libtool: unrecognized option `-static'
libtool: Try `libtool --help' for more information.
make: *** [Release/sqlite3.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Applications/Atom.app/Contents/Resources/app/apm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 15.6.0
gyp ERR! command "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/node-gyp" "build" "--fallback-to-build" "--module=/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64"
gyp ERR! cwd /private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Applications/Atom.app/Contents/Resources/app/apm/bin/node /Applications/Atom.app/Contents/Resources/app/apm/bin/../node_modules/.bin/node-gyp build --fallback-to-build --module=/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Darwin 15.6.0
node-pre-gyp ERR! command "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/node_modules/atom-import-js/node_modules/sqlite3
node-pre-gyp ERR! node -v v6.9.5
node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/package.json'
npm WARN apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor No description
npm WARN apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor No repository field.
npm WARN apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor No README data
npm WARN apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor No license field.
npm ERR! Darwin 15.6.0
npm ERR! argv "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Users/mpokrovskii/.atom/.apm/.apmrc" "--userconfig" "/Users/mpokrovskii/.atom/.apmrc" "install" "/private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/d-11749-11974-1kgp97x.f12mwh4cxr/package.tgz" "--runtime=electron" "--target=1.3.13" "--arch=x64" "--global-style"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /private/var/folders/_2/x5857l3j0c1cqk5cphrgt22m0000gn/T/apm-install-dir-11749-11974-1vc5bt7.za5b0dlsor/npm-debug.log
npm ERR! code 1

"Goto word" always opens new window when running Atom in dev mode

I'm almost always running Atom in dev mode, as I'm using some packages that I'm also hacking on.

I checked the source code and seems like it should never open a new window: https://github.com/Galooshi/atom-import-js/blob/master/lib/import-js.js#L138

I tried various things:

  • Restart the whole Atom
  • Opening Atom in my current project dir on command line with atom -d .
  • Opening Atom atom -d and then from it File -> Add Project Folder...

...but no success. Only when I switch Atom to non-dev mode will it open a new tab as expected.

no imports can be found with watchman

When ever I install watchman no imports are found. As soon as I uninstall it the imports are found again.

This works for small projects but not for some of the bigger ones. I simply installed watchman, as far as I can tell there is no further configuration required by import-js.

Uncaught TypeError: Cannot read property 'stripFileExtensions' of undefined

[Enter steps to reproduce below:]

  1. lookupPath is "./"
  2. trying to import Application, one file at "./af/.travis/Application.js" takes care of tests, The file to import is at "./af/core/prototypes/Applications.js". If I rename "./af/.travis/Application.js" the import works without any problem.

Atom Version: 1.8.0
System: Mac OS X 10.11.5
Thrown From: atom-import-js package, v0.2.2

Stack Trace

Uncaught TypeError: Cannot read property 'stripFileExtensions' of undefined

At /Users/Jovan/.atom/packages/atom-import-js/node_modules/import-js/build/Configuration.js:216

TypeError: Cannot read property 'stripFileExtensions' of undefined
    at Configuration.get (/Users/Jovan/.atom/packages/atom-import-js/node_modules/import-js/build/Configuration.js:216:9)
    at /Users/Jovan/.atom/packages/atom-import-js/node_modules/import-js/build/findJsModulesFor.js:99:37
    at Array.forEach (native)
    at /Users/Jovan/.atom/packages/atom-import-js/node_modules/import-js/build/findJsModulesFor.js:88:64
    at Array.forEach (native)
    at findImportsFromLocalFiles (/Users/Jovan/.atom/packages/atom-import-js/node_modules/import-js/build/findJsModulesFor.js:87:29)
    at findJsModulesFor (/Users/Jovan/.atom/packages/atom-import-js/node_modules/import-js/build/findJsModulesFor.js:130:87)
    at Importer.findOneJsModule (/Users/Jovan/.atom/packages/atom-import-js/node_modules/import-js/build/Importer.js:278:54)
    at Importer._import (/Users/Jovan/.atom/packages/atom-import-js/node_modules/import-js/build/Importer.js:92:27)
    at inCurrentWorkingDirectory (/Users/Jovan/.atom/packages/atom-import-js/lib/import-js.js:122:70)
    at inCurrentWorkingDirectory (/Users/Jovan/.atom/packages/atom-import-js/lib/import-js.js:20:18)
    at importWord (/Users/Jovan/.atom/packages/atom-import-js/lib/import-js.js:122:18)
    at atom-workspace.subscriptions.add.atom.commands.add.import-js:import (/Users/Jovan/.atom/packages/atom-import-js/lib/import-js.js:159:33)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (/Applications/Atom.app/Contents/Resources/app.asar/src/atom-environment.js:1106:28)
    at EventEmitter.outerCallback (/Applications/Atom.app/Contents/Resources/app.asar/src/application-delegate.js:340:25)
    at emitThree (events.js:97:13)
    at EventEmitter.emit (events.js:175:7)

Commands

     -8:29.1.0 import-js:fix-imports (atom-text-editor.editor.power-mode.is-focused)
     -8:20.3.0 import-js:import (atom-text-editor.editor.power-mode.is-focused)
     -8:15 import-js:goto (atom-text-editor.editor.power-mode.is-focused)
  2x -8:05.4.0 editor:newline (atom-text-editor.editor.power-mode.is-focused)
     -8:02.2.0 autocomplete-plus:confirm (atom-text-editor.editor.power-mode.is-focused.autocomplete-active)
     -7:58 core:move-down (atom-text-editor.editor.power-mode.is-focused.autocomplete-active)
     -7:57.7.0 autocomplete-plus:confirm (atom-text-editor.editor.power-mode.is-focused.autocomplete-active)
 12x -7:55.8.0 core:move-left (atom-text-editor.editor.power-mode.is-focused)
     -7:53.6.0 core:move-right (atom-text-editor.editor.power-mode.is-focused)
     -7:53.4.0 core:backspace (atom-text-editor.editor.power-mode.is-focused)
 11x -7:52.9.0 core:move-right (atom-text-editor.editor.power-mode.is-focused)
     -7:49 core:save (atom-text-editor.editor.power-mode.is-focused)
     -7:43.2.0 import-js:import (atom-text-editor.editor.power-mode.is-focused)
     -7:33.4.0 import-js:fix-imports (atom-text-editor.editor.power-mode.is-focused)
     -7:15.1.0 window:toggle-dev-tools (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
  2x -6:20.9.0 import-js:import (atom-text-editor.editor.power-mode.is-focused)

Config

{
  "core": {
    "packagesWithKeymapsDisabled": [
      "project-ring"
    ]
  }
}

Installed Packages

# User
activate-power-mode, v0.5.2
atom-import-js, v0.2.2
atom-ternjs, v0.14.2
auto-indent, v0.5.0
build, v0.64.0
build-cargo, v0.15.0
build-grunt, v0.4.0
build-gulp, v0.11.0
busy, v0.5.0
color-picker, v2.1.1
css-color-underline, v1.0.1
docs-snippets, v0.8.0
emmet, v2.4.3
file-type-icons, v1.3.0
language-rust, v0.4.6
linter, v1.11.11
linter-csslint, v1.3.2
linter-eslint, v7.2.2
linter-jshint, v2.1.0
linter-jsonlint, v1.2.5
linter-perl, v0.8.0
linter-php, v1.2.0
linter-rust, v0.4.6
linter-sass-lint, v1.6.1
merge-conflicts, v1.4.4
project-ring, v0.39.0
racer, v0.20.0
travis-ci-status, v1.1.1

# Dev
No dev packages

Uncaught RangeError: Maximum call stack size exceeded

[Enter steps to reproduce:]

  1. Try to activate any of the 3 commands

Atom: 1.16.0 ia32
Electron: 1.3.13
OS: Microsoft Windows 7 Professional (64-bit)
Thrown From: atom-import-js package 0.6.1

Stack Trace

Uncaught RangeError: Maximum call stack size exceeded

At path.js:64

RangeError: Maximum call stack size exceeded
    at String.slice (native)
    at normalizeStringWin32 (path.js:64:22)
    at Object.normalize (path.js:403:14)
    at Object.join (path.js:527:18)
    at findRecursive (/packages/atom-import-js/node_modules/import-js/build/findProjectRoot.js:28:10)
    (then the above line repeated as many times as possible)
    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 importWord (/packages/atom-import-js/lib/import-js.js:112:3)
    at /packages/atom-import-js/lib/import-js.js:150:33)
    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:1185: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)

Non-Core Packages

atom-import-js 0.6.1 
autocomplete-modules 1.6.9 
file-type-icons 1.3.3 
file-types 0.5.5 
language-babel 2.57.1 
language-javascript-semantic 0.2.1 
linter 1.11.23 
linter-eslint 8.1.7 
pigments 0.39.1 
project-manager 3.3.4 
shortcuts 0.1.0 
simple-drag-drop-text 0.3.4 
windows-build-tools 1.0.0 

Option for adding import line without auto-sorting imports

I'm working on a project with a team that predominantly uses VSCode and the import sorting algorithms there differ than what this package implements. I peeked at the code with the intention of splitting off the import adding from the import sorting (and configuring that with an option on this package), but it looks like the functionality is passed off to the import-js package.

My questions currently - is my goal possible? Does the import-js package support this (I haven't dug through that source code yet)?

Thanks!

Doesn't seem to work on windows?

Steps to reproduce

  1. installed atom-import-js
  2. added keybinding for windows:
'atom-workspace':
  'ctrl-shift-i': 'import-js:import'

  1. Selected module name in .js file.
  2. Press ctrl-shift-i
  3. get error below:

Atom Version: 1.7.4
System: Microsoft Windows 8.1 Pro
Thrown From: atom-import-js package, v0.2.2

Stack Trace

Uncaught Error: undefined

At C:\Users\jallan\.atom\packages\atom-import-js\node_modules\import-js\build\findMatchingFiles.js:45

Error: undefined
    at findMatchingFiles (C:\Users\jallan\.atom\packages\atom-import-js\node_modules\import-js\build\findMatchingFiles.js:45:11)
    at C:\Users\jallan\.atom\packages\atom-import-js\node_modules\import-js\build\findJsModulesFor.js:88:37
    at Array.forEach (native)
    at findImportsFromLocalFiles (C:\Users\jallan\.atom\packages\atom-import-js\node_modules\import-js\build\findJsModulesFor.js:87:29)
    at findJsModulesFor (C:\Users\jallan\.atom\packages\atom-import-js\node_modules\import-js\build\findJsModulesFor.js:130:87)
    at Importer.findOneJsModule (C:\Users\jallan\.atom\packages\atom-import-js\node_modules\import-js\build\Importer.js:278:54)
    at Importer._import (C:\Users\jallan\.atom\packages\atom-import-js\node_modules\import-js\build\Importer.js:92:27)
    at inCurrentWorkingDirectory (C:\Users\jallan\.atom\packages\atom-import-js\lib\import-js.js:122:70)
    at inCurrentWorkingDirectory (C:\Users\jallan\.atom\packages\atom-import-js\lib\import-js.js:20:18)
    at importWord (C:\Users\jallan\.atom\packages\atom-import-js\lib\import-js.js:122:18)
    at atom-workspace.subscriptions.add.atom.commands.add.import-js:import (C:\Users\jallan\.atom\packages\atom-import-js\lib\import-js.js:159:33)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\jallan\AppData\Local\atom\app-1.7.4\resources\app.asar\src\command-registry.js:260:29)
    at C:\Users\jallan\AppData\Local\atom\app-1.7.4\resources\app.asar\src\command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\jallan\AppData\Local\atom\app-1.7.4\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:580:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\jallan\AppData\Local\atom\app-1.7.4\resources\app.asar\node_modules\atom-keymap\lib\keymap-manager.js:388:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (C:\Users\jallan\AppData\Local\atom\app-1.7.4\resources\app.asar\src\window-event-handler.js:98:36)
    at HTMLDocument.<anonymous> (C:\Users\jallan\AppData\Local\atom\app-1.7.4\resources\app.asar\src\window-event-handler.js:3:61)

Commands

     -0:04.6.0 import-js:import (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "atom-ternjs"
    ],
    "ignoredNames": [
      "node_modules",
      "coverage",
      "doc"
    ],
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
atom-import-js, v0.2.2
atom-import-sort, v0.6.0
atom-wallaby, v1.0.7
autocomplete-modules, v1.4.1
emmet-simplified, v2.5.0
fold-functions, v0.4.3
linter, v1.11.3
linter-eslint, v7.2.2
open_in_cmd, v0.6.0
react, v0.14.1
simple-copy-path, v1.0.0

# Dev
No dev packages

Excluding folder .meteor does not work

ImportJS is really cool, but I have problems excluding the folder .meteor.

Here's my setup:

module.exports = {
  declarationKeyword: 'import',
  environments: [
    'meteor', 'browser'
  ],
  excludes: ['.meteor/**', 'private/**', 'public/**']
}

To my understanding, this should exclude the .meteor folder, but it doesn't. I still get results from that folder.

I also tried /.meteor/** and .**/**, but none of them worked. If I try it in globtester, they are matched correctly.

Add tests

This project could benefit from some automated testing.

Failed to activate the atom-import-js package

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.34.0 x64
Electron: 2.0.16
OS: Mac OS X 10.14.2
Thrown From: atom-import-js package 0.21.0

Stack Trace

Failed to activate the atom-import-js package

At Cannot find module '/Users/daniel/.atom/packages/atom-import-js/node_modules/sqlite3/lib/binding/electron-v2.0-darwin-x64/node_sqlite3.node'

Error: Cannot find module '/Users/daniel/.atom/packages/atom-import-js/node_modules/sqlite3/lib/binding/electron-v2.0-darwin-x64/node_sqlite3.node'
    at Module._resolveFilename (module.js:543:15)
    at Module._resolveFilename (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.get_Module._resolveFilename (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/app/static/<embedded>:11:154667)
    at Module.require (/app.asar/static/index.js:40:43)
    at require (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/app/static/<embedded>:11:145974)
    at /packages/atom-import-js/node_modules/sqlite3/lib/sqlite3.js:4:15)
    at /packages/atom-import-js/node_modules/sqlite3/lib/sqlite3.js:190:3)
    at Module.get_Module._compile (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/app/static/<embedded>:11:146684)
    at Object.value [as .js] (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/app/static/<embedded>:11:150231)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/app/static/<embedded>:11:145974)
    at /packages/atom-import-js/node_modules/import-js/build/ExportsStorage.js:8:38)
    at /packages/atom-import-js/node_modules/import-js/build/ExportsStorage.js:423:3)
    at Module.get_Module._compile (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/app/static/<embedded>:11:146684)
    at Object.value [as .js] (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/app/static/<embedded>:11:150231)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)
    at Module.require (/app.asar/static/index.js:47:45)
    at require (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/app/static/<embedded>:11:145974)
    at /packages/atom-import-js/node_modules/import-js/build/ModuleFinder.js:14:46)
    at /packages/atom-import-js/node_modules/import-js/build/ModuleFinder.js:359:3)
    at Module.get_Module._compile (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/app/static/<embedded>:11:146684)
    at Object.value [as .js] (/private/var/folders/k2/9__zh42x0h93t11vdr8mmx900000gn/T/AppTranslocation/5A422191-FFD5-496C-9AE0-64F41038452C/d/Atom.app/Contents/Resources/app/static/<embedded>:11:150231)
    at Module.load (module.js:561:32)
    at tryModuleLoad (module.js:504:12)
    at Function.Module._load (module.js:496:3)

Commands

Non-Core Packages

advanced-open-file 0.16.8 
atom-beautify 0.33.4 
atom-html-preview 0.2.6 
atom-ide-ui 0.13.0 
atom-import-js 0.21.0 
atom-material-syntax 1.0.8 
atom-material-ui 2.1.3 
atom-ternjs 0.18.3 
atom-typescript 12.5.3 
auto-close-html2 0.7.0 
busy-signal 2.0.0 
custom-folds 1.9.5 
emmet 2.4.3 
file-icons 2.1.28 
fonts 3.2.0 
gl-light-syntax 3.0.0 
intentions 1.1.5 
line-count 0.5.0 
linter 2.3.0 
linter-eslint 8.5.0 
linter-jshint 3.1.11 
linter-tslint 1.10.4 
linter-ui-default 1.7.1 
pigments 0.40.2 
restart-atom 0.2.0 
seti-ui 1.11.0 
teletype 0.13.3 
terminal-tab 0.5.7 
todo-show 2.3.2 

Some installed packages could not be loaded because they contain native modules that were compiled for an earlier version of Atom.

Rebuild Failed atom-import-js 0.21.0

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.2/electron-v3.1-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (electron-v3.1 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (electron-v3.1 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error Connection closed while downloading tarball file

How to clear the cache of files?

I did some batch-renaming of files outside Atom, and now the "Go to word" command takes me to old file that doesn't exist any more.

I've tried restarting Atom, but didn't help.

I know that import-js has some sort of cache, which I think is the culprit in here. But I don't have import-js installed separately from Atom. How do I find out the location of the cache to clear it?

plugin doesn't see my .importjs.js file

my config looks like this:

module.exports = {
  declarationKeyword: 'import',
  environments: ['meteor', 'node'],
};

when I type "Meteor" in a .js file, and hit cmd+shift+j, it adds the line:

const { Meteor } = require('meteor/meteor');

but what I want it to add is

import { Meteor } from 'meteor/meteor';

Run command `Fix imports` on save

It could be very useful to have an option to run automatically the Fix imports command when saving a file.
Most of sorting import plugin have this plugin but their reordering are a bit strange compare to atom-import- js

"Go to word" bug when there is no module for word

when the cursor is over a variable that has a module, cmd+shift+k (keybinding for "go to word") works like a charm.

however, if the cursor is over anything that does not have a module to go to, the appropriate No JS module found for ____ warning does appears, but a new blank window also decides to open (equivalent to a cmd+shift+n action).

  • the same occurs when using the Goto word under cursor option in the Packages > ImportJS tab

this plugin is super great and handy, thanks!

Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option

Atom 1.29.0 - Mac 10.11 - in a meteor project - cmd-shift-i gives this error:

Uncaught (in promise) Error: Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean.
    at new Importer (/Users/usernam/.atom/packages/atom-import-js/node_modules/import-js/build/Importer.js:118)
    at getImporter (/Users/usernam/.atom/packages/atom-import-js/lib/getImporter.js:8)
    at withModuleFinder (/Users/usernam/.atom/packages/atom-import-js/lib/import-js.js:121)
    at initializeModuleFinder.then.catch (/Users/usernam/.atom/packages/atom-import-js/lib/withModuleFinder.js:8)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188)
Importer @ /Users/usernam/.atom/packages/atom-import-js/node_modules/import-js/build/Importer.js:118
getImporter @ /Users/usernam/.atom/packages/atom-import-js/lib/getImporter.js:8
withModuleFinder @ /Users/usernam/.atom/packages/atom-import-js/lib/import-js.js:121
initializeModuleFinder.then.catch @ /Users/usernam/.atom/packages/atom-import-js/lib/withModuleFinder.js:8
_tickCallback @ internal/process/next_tick.js:188
Promise rejected (async)
withModuleFinder @ /Users/usernam/.atom/packages/atom-import-js/lib/withModuleFinder.js:6
fixImports @ /Users/usernam/.atom/packages/atom-import-js/lib/import-js.js:120
import-js:fix-imports @ /Users/usernam/.atom/packages/atom-import-js/lib/import-js.js:155
handleCommandEvent @ commitCommentContainer_item.graphql.js:112
module.exports.KeymapManager.dispatchCommandEvent @ commitCommentContainer_item.graphql.js:112
module.exports.KeymapManager.handleKeyboardEvent @ commitCommentContainer_item.graphql.js:112
handleDocumentKeyEvent @ commitCommentContainer_item.graphql.js:112

any known workarounds

Failed install

My version 1.45.0
I can not install your package! I need him urgently

> [email protected] install /tmp/apm-install-dir-12047-19848-1ha80k3.zyrgl/node_modules/atom-import-js/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

[sqlite3] Success: "/tmp/apm-install-dir-12047-19848-1ha80k3.zyrgl/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v4.2-linux-x64/node_sqlite3.node" is installed via remote

node-pre-gyp WARN Using needle for node-pre-gyp https download 
Aborted
npm WARN enoent ENOENT: no such file or directory, open '/tmp/apm-install-dir-12047-19848-1ha80k3.zyrgl/package.json'
npm WARN apm-install-dir-12047-19848-1ha80k3.zyrgl No description
npm WARN apm-install-dir-12047-19848-1ha80k3.zyrgl No repository field.
npm WARN apm-install-dir-12047-19848-1ha80k3.zyrgl No README data
npm WARN apm-install-dir-12047-19848-1ha80k3.zyrgl No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/i/.atom/.apm/_logs/2020-05-07T04_17_16_982Z-debug.log

Panel broken in atom-material-ui theme

The atom material ui theme has this style

/* /Users/bennyp/.atom/packages/atom-material-ui/index.less */
.overlay, atom-panel.modal {
    color: rgba(221, 221, 221, 0.65);
    background-color: #212121;
    font-size: 12px;
    padding: 10px;
    box-shadow: 0 0 10px transparent;
    border-radius: 0.125rem;
    overflow: hidden;
    box-shadow: 0 0.625rem 1.25rem rgba(0, 0, 0, 0.19), 0 0.375rem 0.375rem rgba(0, 0, 0, 0.23);
}

which sets overflow: hidden on the dropdown.

anyone coming here with this problem can add this to their stylesheet to fix it

.theme-atom-material-ui {
  .overlay, atom-panel.modal {
    overflow: initial;
  }
}

Uncaught Error: /bin/sh: -c: line 0: syntax error near unexpected token `('/bin/sh: -c: line 0: ...

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.8.0
System: Mac OS X 10.11.5
Thrown From: atom-import-js package, v0.2.2

Stack Trace

Uncaught Error: /bin/sh: -c: line 0: syntax error near unexpected token (' /bin/sh: -c: line 0:find . -name "*.js" -not -path "./node_modules/" | egrep -i "(/|^)opportunity(es|s)?.?search(es|s)?.?result"(/index)?(/package)?.js."'

At /Users/wang/.atom/packages/atom-import-js/node_modules/import-js/build/findMatchingFiles.js:45

Error: /bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `find . -name "**.js*" -not -path "./node_modules/*" | egrep -i "(/|^)opportunity(es|s)?.?search(es|s)?.?result"(/index)?(/package)?.js.*"'

  at findMatchingFiles (/Users/wang/.atom/packages/atom-import-js/node_modules/import-js/build/findMatchingFiles.js:45:11)
  at /Users/wang/.atom/packages/atom-import-js/node_modules/import-js/build/findJsModulesFor.js:88:37
  at Array.forEach (native)
  at findImportsFromLocalFiles (/Users/wang/.atom/packages/atom-import-js/node_modules/import-js/build/findJsModulesFor.js:87:29)
  at findJsModulesFor (/Users/wang/.atom/packages/atom-import-js/node_modules/import-js/build/findJsModulesFor.js:130:87)
  at Importer.findOneJsModule (/Users/wang/.atom/packages/atom-import-js/node_modules/import-js/build/Importer.js:278:54)
  at Importer._import (/Users/wang/.atom/packages/atom-import-js/node_modules/import-js/build/Importer.js:92:27)
  at inCurrentWorkingDirectory (/Users/wang/.atom/packages/atom-import-js/lib/import-js.js:122:70)
  at inCurrentWorkingDirectory (/Users/wang/.atom/packages/atom-import-js/lib/import-js.js:20:18)
  at importWord (/Users/wang/.atom/packages/atom-import-js/lib/import-js.js:122:18)
  at atom-workspace.subscriptions.add.atom.commands.add.import-js:import (/Users/wang/.atom/packages/atom-import-js/lib/import-js.js:159:33)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:580:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:388:22)
  at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:98:36)
  at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

     -0:44.6.0 editor:newline (atom-text-editor.editor.power-mode.is-focused)
  4x -0:42.3.0 core:backspace (atom-text-editor.editor.power-mode.is-focused.autocomplete-active)
     -0:40.9.0 core:move-up (atom-text-editor.editor.power-mode.is-focused)
     -0:40.7.0 editor:delete-line (atom-text-editor.editor.power-mode.is-focused)
     -0:40.5.0 core:save (atom-text-editor.editor.power-mode.is-focused)
     -0:39.8.0 editor:move-to-end-of-screen-line (atom-text-editor.editor.power-mode.is-focused)
  6x -0:36.1.0 core:backspace (atom-text-editor.editor.power-mode.is-focused)
  7x -0:28.1.0 core:move-left (atom-text-editor.editor.power-mode.is-focused)
     -0:26.4.0 editor:select-to-end-of-line (atom-text-editor.editor.power-mode.is-focused)
     -0:23.6.0 autocomplete-plus:confirm (atom-text-editor.editor.power-mode.is-focused.autocomplete-active)
  2x -0:21.6.0 core:backspace (atom-text-editor.editor.power-mode.is-focused.autocomplete-active)
     -0:20.4.0 autocomplete-plus:cancel (atom-text-editor.editor.power-mode.is-focused.autocomplete-active)
     -0:20 core:save (atom-text-editor.editor.power-mode.is-focused)
  2x -0:19.6.0 editor:auto-indent (atom-text-editor.editor.power-mode.is-focused)
     -0:19.2.0 core:save (atom-text-editor.editor.power-mode.is-focused)
     -0:01.3.0 import-js:import (atom-text-editor.editor.power-mode.is-focused)

Config

{
  "core": {
    "closeEmptyWindows": false,
    "customFileTypes": {
      "source.ini": [
        ".buckconfig",
        ".flowconfig"
      ],
      "source.json": [
        ".arcconfig",
        "BUCK.autodeps"
      ],
      "source.python": [
        "BUCK"
      ]
    },
    "disabledPackages": [
      "atom-beautify",
      "preview-plus",
      "terminal-plus",
      "language-objective-c",
      "tree-view",
      "script",
      "autocomplete-modules",
      "linter"
    ],
    "packagesWithKeymapsDisabled": [
      "ever-notedown"
    ],
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
activate-power-mode, v0.6.0
aligner, v0.22.0
atom-alignment, v0.12.1
atom-import-js, v0.2.2
atom-react-native-autocomplete, v0.0.27
atomic-chrome, v0.3.0
console-log, v1.5.1
docblockr, v0.7.3
eclipse-keybindings, v0.9.0
ever-notedown, v0.2.22
file-icons, v1.7.15
fwd-back, v0.1.0
git-time-machine, v1.5.3
goto-last-edit, v0.3.2
highlight-selected, v0.11.2
indent-guide-improved, v1.4.9
js-hyperclick, v1.4.2
language-javascript-jsx, v0.3.7
linter-eslint, v7.2.4
merge-conflicts, v1.4.4
nuclide, v0.148.0
pretty-json, v1.4.1
react, v0.15.0
tidy-markdown, v3.0.1

# Dev
No dev packages

Always adds require() instead of import statements, regardless of config

This looks like a really useful module, but I can't get it working properly. When I run 'fix imports', it nearly always adds const foo = require('foo') statements.

I tried setting it explicitly:

module.exports = {
  declarationKeyword: 'import',
}

But it still doesn't work. I have just installed it now, so I should be on the latest version. What could I be doing wrong?

Atom Helper process takes up 100% CPU

Whenever I execute any of the atom-import-js commands, the CPU goes to 100% and everything in Atom becomes terribly slow.

This happens regardless of whether I run Atom in normal or in dev mode.

Output from top command:

PID    COMMAND      %CPU  TIME     #TH   #WQ  #PORTS  MEM    PURG   CMPRS  PGRP  PPID  STATE    BOOSTS             %CPU_ME
24337  Atom Helper  126.0 02:44.47 22/1  1    158+    285M-  0B     0B     24325 24325 running  *0[2]              0.00000
5174   node         31.9  06:53:28 10/3  0    33      2852K  0B     475M   5170  5173  running  *0[1]              0.00000
2346   Google Chrom 6.7   56:04.13 18    1    184+    287M+  0B     88M    352   352   sleeping *0[1]              0.00000

hyperclick support

would be great if hyperclick (cmd-click on variable) worked for the Go to word action

APM can't install SQLite3 dependency

Basically node-gyp is super oudated, if you run Windows 10 with some recent compiler (VS2015, VS2017) it will not work, no matter what.
The supposedly pre-built binaries are nowhere to be found either, so no SQLite3 is available.

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/electron-v1.3-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (electron-v1.3 ABI) (falling back to source compile with node-gyp)

Please consider switching to something different, as this is not the first issue regarding the install process.

Updating to “[email protected]” failed

I can’t update to the latest version. I’m not sure if this is an issue specific to this package, or something wrong with Atom or my setup, but updating other packages works fine. Here’s the output from Atom’s updater:

> [email protected] install /private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3150000/sqlite3.c
  TOUCH Release/obj.target/deps/action_before_build.stamp
  CC(target) Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o
  LIBTOOL-STATIC Release/sqlite3.a
Failed to execute '/Applications/Atom.app/Contents/Resources/app/apm/bin/node /Applications/Atom.app/Contents/Resources/app/apm/bin/../node_modules/.bin/node-gyp build --fallback-to-build --module=/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64' (1)
/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4
`-- (empty)


(node) warning: possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at TLSSocket.addListener (events.js:239:17)
    at TLSSocket.Readable.on (_stream_readable.js:673:33)
    at Request.<anonymous> (/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm-registry-client/lib/request.js:153:7)
    at emitOne (events.js:77:13)
    at Request.emit (events.js:169:7)
    at ClientRequest.<anonymous> (/Applications/Atom.app/Contents/Resources/app/apm/node_modules/request/request.js:823:10)
    at emitOne (events.js:82:20)
    at ClientRequest.emit (events.js:169:7)
    at tickOnSocket (_http_client.js:502:7)
    at onSocketNT (_http_client.js:514:5)
node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.8/electron-v1.3-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (electron-v1.3 ABI) (falling back to source compile with node-gyp) 
gyp WARN download NVM_IOJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use IOJS_ORG_MIRROR
gyp WARN download NVM_IOJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use IOJS_ORG_MIRROR
gyp WARN download NVM_IOJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use IOJS_ORG_MIRROR
libtool: unrecognized option `-static'
libtool: Try `libtool --help' for more information.
make: *** [Release/sqlite3.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Applications/Atom.app/Contents/Resources/app/apm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 16.4.0
gyp ERR! command "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/.bin/node-gyp" "build" "--fallback-to-build" "--module=/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64"
gyp ERR! cwd /private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3
gyp ERR! node -v v4.4.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Applications/Atom.app/Contents/Resources/app/apm/bin/node /Applications/Atom.app/Contents/Resources/app/apm/bin/../node_modules/.bin/node-gyp build --fallback-to-build --module=/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3/lib/binding/electron-v1.3-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:827:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 16.4.0
node-pre-gyp ERR! command "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/node_modules/atom-import-js/node_modules/sqlite3
node-pre-gyp ERR! node -v v4.4.5
node-pre-gyp ERR! node-pre-gyp -v v0.6.31
node-pre-gyp ERR! not ok 
npm WARN enoent ENOENT: no such file or directory, open '/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/package.json'
npm WARN apm-install-dir-11717-93563-omndu4 No description
npm WARN apm-install-dir-11717-93563-omndu4 No repository field.
npm WARN apm-install-dir-11717-93563-omndu4 No README data
npm WARN apm-install-dir-11717-93563-omndu4 No license field.
npm ERR! Darwin 16.4.0
npm ERR! argv "/Applications/Atom.app/Contents/Resources/app/apm/bin/node" "/Applications/Atom.app/Contents/Resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/Users/jeanfredrik/.atom/.apm/.apmrc" "--userconfig" "/Users/jeanfredrik/.atom/.apmrc" "install" "/private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/d-11717-93563-12it01y/package.tgz" "--runtime=electron" "--target=1.3.13" "--arch=x64" "--global-style"
npm ERR! node v4.4.5
npm ERR! npm  v3.10.5
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sqlite3 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sqlite3
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sqlite3
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /private/var/folders/8w/vyccth4s0xj_1zsm9ljkw7_00000gq/T/apm-install-dir-11717-93563-omndu4/npm-debug.log
npm ERR! code 1

Constant used only as array index is removed/not imported

Let's say that I have a constant used like

doSomething( catalog[CATEGORY_PACKAGES] );

since the constant is only used as an index, it won't be imported and if manually added it will be removed the next time I use the fix imports.

import word gets confused with syntax

seems to have a problem with characters that come before and after a symbol. See image for example. This is latest version of Atom & Atom-import-js.

image

Failed to load the atom-import-js package

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.2.4
System: Ubuntu 14.04.3
Thrown From: atom-import-js package, v0.2.0

Stack Trace

Failed to load the atom-import-js package

At Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:413:25)
    at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:190: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 (module.js:384:17)
    at Object.<anonymous> (/home/devbwh/.atom/packages/atom-import-js/lib/import-js.js:10:21)
    at Module._compile (module.js:434:26)
    at Object.defineProperty.value [as .js] (/usr/share/atom/resources/app.asar/src/compile-cache.js:190:21)

Commands

Config

{
  "core": {}
}

Installed Packages

# User
atom-html-preview, v0.1.19
atom-import-js, v0.2.0
atom-jshint, v2.0.0
atom-terminal-panel, v4.4.4
atom-ternjs, v0.13.2
atomic-chrome, v0.3.0
autocomplete-modules, v1.4.1
emmet, v2.4.3
file-icons, v1.7.7
formatter-json, v1.0.1
jquery-snippets, v11.0.0
jsformat, v0.9.3
minimap, v4.23.5
run-in-browser, v0.1.3
sync-settings, v0.7.2
terminal-plus, v0.14.5

# Dev
No dev packages

Import dosen't works anymore :'(

There are the errors i've in Atom:
image

I'm on Linux: Ubuntu
I need this magic plugin works on Atom.
I was on phpStorm be Atom is really nice but this plugin is price less.

Thx for your works.
I swear to see it fix in a moment. :)

Doesn't work with ES6 rest spread operators

Doesn't work on files where I use destructuring assignment operators.
Throws a parse error when I do "fix imports".

example code
let { name, surname, ...other } = this.props;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.