{"action":"closed","issue":{"url":"https://api.github.com/repos/mhartington/nvim-typescript/issues/97","repository_url":"https://api.github.com/repos/mhartington/nvim-typescript","labels_url":"https://api.github.com/repos/mhartington/nvim-typescript/issues/97/labels{/name}","comments_url":"https://api.github.com/repos/mhartington/nvim-typescript/issues/97/comments","events_url":"https://api.github.com/repos/mhartington/nvim-typescript/issues/97/events","html_url":"https://github.com/mhartington/nvim-typescript/issues/97","id":278029708,"number":97,"title":"path to tsc not specified resulting in error on neovim startup","user":{"login":"kiyanwang","id":1135464,"avatar_url":"https://avatars2.githubusercontent.com/u/1135464?v=4","gravatar_id":"","url":"https://api.github.com/users/kiyanwang","html_url":"https://github.com/kiyanwang","followers_url":"https://api.github.com/users/kiyanwang/followers","following_url":"https://api.github.com/users/kiyanwang/following{/other_user}","gists_url":"https://api.github.com/users/kiyanwang/gists{/gist_id}","starred_url":"https://api.github.com/users/kiyanwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiyanwang/subscriptions","organizations_url":"https://api.github.com/users/kiyanwang/orgs","repos_url":"https://api.github.com/users/kiyanwang/repos","events_url":"https://api.github.com/users/kiyanwang/events{/privacy}","received_events_url":"https://api.github.com/users/kiyanwang/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-30T08:02:32Z","updated_at":"2017-11-30T13:27:23Z","closed_at":"2017-11-30T13:27:23Z","author_association":"NONE","body":"# Problems summary\r\n\r\nI've been using nvim-typescript with deoplete for several months now without any issues.  Today I updated a load of my vim plugins, including nvim-typescript, deoplete etc.  An noticed that when I open any ts file up i get the following error: \r\n\r\n```\r\nerror caught in async handler '/Users/nadeemshabir/.vim/bundle/nvim-typescript/rplugin/python3/nvim-typescript:function:TSOnBufEnter [[]]'\r\nTraceback (most recent call last):\r\n  File \"/Users/nadeemshabir/.vim/bundle/nvim-typescript/rplugin/python3/nvim-typescript/__init__.py\", line 609, in on_bufenter\r\n    self.tsstart()\r\n  File \"/Users/nadeemshabir/.vim/bundle/nvim-typescript/rplugin/python3/nvim-typescript/__init__.py\", line 72, in tsstart\r\n    self._client.setTsConfig()\r\n  File \"/Users/nadeemshabir/.vim/bundle/nvim-typescript/rplugin/python3/nvim-typescript/client.py\", line 50, in setTsConfig\r\n    rawOutput = subprocess.check_output(['tsc', '--version'])\r\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/subprocess.py\", line 604, in check_output\r\n    with Popen(*popenargs, stdout=PIPE, **kwargs) as process:\r\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/subprocess.py\", line 856, in __init__\r\n    restore_signals, start_new_session)\r\n  File \"/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/subprocess.py\", line 1464, in _execute_child\r\n    raise child_exception_type(errno_num, err_msg)\r\nFileNotFoundError: [Errno 2] No such file or directory: 'tsc'\r\nPress ENTER or type command to continue\r\n```\r\n\r\nRunning`:CheckHealth` passes since `tsserver` is found in the correct location (local `node_modules/.bin/`, but for some reason `tsc` is not and there's no health check for that.\r\n\r\n```bash\r\n\r\nhealth#deoplete#check\r\n========================================================================\r\n## deoplete.nvim\r\n  - OK: has(\"nvim\") was successful\r\n  - OK: has(\"python3\") was successful\r\n  - INFO: If you're still having problems, try the following commands:\r\n    $ export NVIM_PYTHON_LOG_FILE=/tmp/log\r\n    $ export NVIM_PYTHON_LOG_LEVEL=DEBUG\r\n    $ nvim\r\n    $ cat /tmp/log_{PID}\r\n    and then create an issue on github\r\n\r\nhealth#nvim_typescript#check\r\n========================================================================\r\n## Find Node\r\n  - OK: node is in $PATH\r\n\r\n## Find Local Typescript\r\n  - OK: local tsserver is found\r\n\r\n## Find Global Typescript\r\n  - OK: No global server found but local server found\r\n\r\n## Check for deoplete\r\n  - OK: Deoplete is found!\r\n\r\n## Check for python 3 bindings\r\n  - OK: has(\"python3\") was successful\r\n\r\nhealth#nvim#check\r\n========================================================================\r\n## Configuration\r\n  - OK: no issues found\r\n\r\n## Performance\r\n  - OK: Build type: Release\r\n\r\n## Remote Plugins\r\n  - OK: Up to date\r\n\r\n## terminal\r\n  - INFO: key_backspace (kbs) terminfo entry: key_backspace=^H\r\n  - INFO: key_dc (kdch1) terminfo entry: key_dc=\\E[3~\r\n  - INFO: $XTERM_VERSION=''\r\n  - INFO: $VTE_VERSION=''\r\n  - INFO: $SSH_TTY=''\r\n```\r\n\r\n\r\nI found where the plugin references `tsc` (https://github.com/mhartington/nvim-typescript/blob/master/rplugin/python3/nvim-typescript/client.py#L49):\r\n\r\n```python\r\n def setTsConfig(self):\r\n        rawOutput = subprocess.check_output(['tsc', '--version'])\r\n        # formats out to be a list [major, minor, patch]\r\n        [major, minor, patch] = rawOutput.rstrip().decode(\r\n                \"utf-8\").split(' ').pop().split('.')\r\n        self.tsConfg = {\"major\": int(major), \"minor\": int(\r\n            minor), \"patch\": int(patch)}\r\n```\r\n\r\nAnd modifed it to make the path explicit:\r\n\r\n```python\r\n        rawOutput = subprocess.check_output(['node_modules/.bin/tsc', '--version'])\r\n```\r\n\r\nThis fixes the problem for me.\r\n\r\nBut I'm concious that I'm not that familiar with the workings of this plugin, I've been using it without any issues until this morning and managed to get past this problem using the hack above. I would really appreciate some guidance on what I can to do to fix this properly?   I don't have typescript installed globally, and would rather not do that because we use `nvm` on a per project basis in order to keep tooling / dependencies set for individual projects.\r\n\r\n## Environment Information\r\n\r\n * terminal: iTerm Mac Osx, zsh\r\n * vim/nvim version:\r\n\r\n```\r\nversion\r\nNVIM v0.2.1\r\nBuild type: Release\r\nLuaJIT 2.0.5\r\nCompilation: /usr/bin/clang -pipe -Os -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_UNIBI_HAS_VAR_FROM -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostic\r\ns-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/config -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/neovim-0.2.1/s\r\nrc -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/sr\r\nc/nvim/auto -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_editors_neovim/neovim/work/build/include\r\nCompiled by macports@sierra.internal.macports.net\r\n\r\nFeatures: +acl +iconv +jemalloc +tui\r\nSee \":help feature-compile\"\r\n\r\n   system vimrc file: \"$VIM/sysinit.vim\"\r\n  fall-back for $VIM: \"/opt/local/share/nvim\"\r\n```\r\n\r\n## Provide a minimal vim rc with less than 50 lines (Required!)\r\n\r\nMy .vimrc file is here: https://github.com/kiyanwang/dotfiles/blob/master/.vimrc \r\n\r\nI use pathogen to install my plugins\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"mhartington"}}