Control: tags -1 pending

Thanks for reporting and sorry for late reply.

I found out about ~/.npm-packages (by default `npm install -g tern` is
using this directory, ~/.npm-global is just used as an example in the
documentation you linked), but I forgot to update patch.

I applied your revisited patch but ycmd in Debian is always trying
to use tern with nodejs (installed by Debian package manager). I hope
this will do the trick.

On 2017-04-08, Mirosław Zalewski wrote:
> Package: ycmd
> Version: 0+20161219+git486b809-1
> Severity: normal
> 
> Dear Maintainer,
> 
> ycmd currently looks for tern (needed for JavaScript completion) in 
> ~/node_modules/tern. As README.Debian states, this is what users would
> get if they run `npm install tern`.
> 
> However, npm in Debian is in so bad shape, that it outright fails to
> install some packages (see e.g. 780789). It has prompted discussion of
> removal of npm from Debian altogether (see 857986). It is very likely
> that people will use npm outside of Debian.
> 
> It seems that upstream currently prefers to install user-wide npm
> modules into `~/.npm-global` (see [1]). ycmd users who follow upstream
> instruction (i.e. majority of them) will fail to get tern running inside
> ycmd, as paths diverge.
> 
> Please consider modifying package to allow for tern to be placed outside
> of `~/node_modules/`.
> 
> Attached is revised 05-tern-support.patch that will look for tern in
> $PATH and resort to ~/node_modules if it was not found.
> 
> Best regards,
> Mirosław Zalewski
> 
> [1] https://docs.npmjs.com/getting-started/fixing-npm-permissions
> 
> *** debian/patches/05-tern-support.patch
> Description: Debian doesn't have node-tern. This patch is making ycmd to
>  use locally installed tern with `npm install tern` command.
> 
> Index: ycmd-0+20161219+git486b809/ycmd/completers/javascript/tern_completer.py
> ===================================================================
> --- 
> ycmd-0+20161219+git486b809.orig/ycmd/completers/javascript/tern_completer.py
> +++ ycmd-0+20161219+git486b809/ycmd/completers/javascript/tern_completer.py
> @@ -36,20 +36,14 @@ from ycmd.completers.completer_utils imp
>  
>  _logger = logging.getLogger( __name__ )
>  
> -PATH_TO_TERN_BINARY = os.path.abspath(
> -  os.path.join(
> -    os.path.dirname( __file__ ),
> -    '..',
> -    '..',
> -    '..',
> -    'third_party',
> -    'tern_runtime',
> -    'node_modules',
> -    'tern',
> -    'bin',
> -    'tern' ) )
> +PATH_TO_TERN_BINARY = utils.PathToFirstExistingExecutable( [ 'tern' ] )
> +if not PATH_TO_TERN_BINARY:
> +  PATH_TO_TERN_BINARY = os.path.join(
> +    os.path.expanduser('~'),
> +    'node_modules',
> +    'tern')
>  
> -PATH_TO_NODE = utils.PathToFirstExistingExecutable( [ 'node' ] )
> +PATH_TO_NODE = utils.PathToFirstExistingExecutable( [ 'nodejs' ] )
>  
>  # host name/address on which the tern server should listen
>  # note: we use 127.0.0.1 rather than localhost because on some platforms
> 
> 
> -- System Information:
> Debian Release: 9.0
>   APT prefers testing
>   APT policy: (990, 'testing'), (400, 'unstable'), (102, 'experimental'), 
> (10, 'stable')
> Architecture: amd64 (x86_64)
> 
> Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores)
> Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8) (ignored: 
> LC_ALL set to pl_PL.UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> 
> Versions of packages ycmd depends on:
> ii  libboost-filesystem1.62.0  1.62.0+dfsg-4
> ii  libboost-python1.62.0      1.62.0+dfsg-4
> ii  libboost-regex1.62.0       1.62.0+dfsg-4
> ii  libboost-system1.62.0      1.62.0+dfsg-4
> ii  libc6                      2.24-9
> ii  libclang1-3.9              1:3.9.1-5
> ii  libgcc1                    1:6.3.0-11
> ii  libpython2.7               2.7.13-2
> ii  libstdc++6                 6.3.0-11
> ii  python-bottle              0.12.13-1
> ii  python-frozendict          0.5-1
> ii  python-future              0.15.2-4
> ii  python-jedi                0.10.0~git1+f05c071-1
> ii  python-requests            2.12.4-1
> ii  python-waitress            1.0.1-1
> ii  python2.7                  2.7.13-2
> pn  python:any                 <none>
> 
> Versions of packages ycmd recommends:
> pn  libclang-common-3.9-dev  <none>
> pn  node-typescript          <none>
> ii  vim-youcompleteme        0+20161219+git194ff33-1
> 
> ycmd suggests no packages.
> 
> -- no debconf information

-- 
regards,
                           Onur Aslan

GPG Key   : E5EF 3C2C 67BC 6F76 DAB3  A40E 7B96 C7AF EB16 673C      .''`.
Website   : https://onur.im                                        : :'  :
Github    : https://github.com/onur                                `. `'`
Debian QA : https://qa.debian.org/developer.php?login=o...@onur.im   `-

Attachment: signature.asc
Description: Digital signature

Reply via email to