Skip to content

Use npm package require-relative to find module path #41

Open

Description

@feix760

Many errors: Can't find file "XXXXXX" in path
We can use require-relative to eaily get real path

Activity

  1. moll commented on Apr 4, 2017

    @moll
    Owner

    I suspect that's because the package resolution algo I wrote for Node.vim isn't seeking for modules recursively up the chain. 😇 I should fix that as I occasionally hit that issue myself, too. As for require-relative, that's a Node module and Node.vim doesn't actually run any of its logic in JavaScript. :)

  2. feix760 commented on Apr 17, 2017

    @feix760
    Author

    We can use system('node vim-node.js') to exe require-relative for get path, i wrote one at https://github.com/feix760/vim-javascript-gf

  3. tomarrell commented on Apr 9, 2018

    @tomarrell

    I've written a small plugin that uses the package.json to resolve Node Path Relative modules https://github.com/tomarrell/vim-npr and is configurable on a project-by-project basis.

    It may help out for your use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions