ember-cli / ember-cli/ember-cli-version-checker

`NPMDependencyVersionChecker` `_jsonPath` is null if `basedir` = `/`

Open
#275 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
24
Forks
20
PR merge metrics
No merged PRs in 30d

Description

While working on a Docker file I encountered a problem where a version check performed by `ember-cli-version-checker` would fail when running in Docker. The error occurred because the Ember app source files were stored at the root of the drive.

In `/src/npm-dependency-version-checker.js` the following code is used for the `_jsonPath` property:

```
this._jsonPath = resolvePackage(this.name, basedir);
```

If `basedir` is `/` then `this._jsonPath` ends up being `null`. So this Docker file would lead to an error:

```
FROM node:14.16.0

# Copy the main application.
COPY . ./

...
ember build
```

This Docker file works correctly though:

```
FROM node:14.16.0

# Copy the main application.
COPY . ./my-ember-app
WORKDIR my-ember-app

...
ember build
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in /src/npm-dependency-version-checker.js at the assignment to _jsonPath, then inspect how resolvePackage handles a basedir of /. Reproduce the Docker-root layout described in the issue and trace why the result is null. Done means the version check no longer fails when the Ember app is stored at the filesystem root.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.