Skip to content

Issue with findProjectRoot within utils.js #43

@jonathan-fielding

Description

@jonathan-fielding

Hello

So I have noticed an issue with the way in which findProjectRoot attempts to find the project root. By doing a indexOf('node_modules) it sometimes gets confused by some file paths:

Example:

/Users/jonathan/Sites/_beamly_node_modules/whitelabel/node_modules/beamly-js-lint/dist

The expected project route should be

/Users/jonathan/Sites/_beamly_node_modules/whitelabel/

But instead the project route is

/Users/jonathan/Sites

This unfortunately is incorrect, because of the indexOf it is finding the directory I store my modules in _beamly_node_modules

Perhaps a valid fall back if it doesnt find a package.json like that would be to use process.cwd() to find the package.json

Thanks

Jonathan

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions