Skip to content

Conversation

erunion
Copy link
Member

@erunion erunion commented Sep 8, 2020

🧰 What's being changed?

This resolves #107 and edge case with the find-cache-dir module where if it can't determine a cache directory, it'll return undefined. When this could crop up is if a user runs npm install api in a fresh directory without a package.json file. Since find-cache-dir looks for the root-most directory with a package.json file to determine where to put its .cache/ directory into node_modules/, it can't.

So to account for this edge case, if we end up with an undefined cache directory from the module we'll instead fallback to creating a temp directory at the OS level.

"form-data": "^3.0.0",
"get-stream": "^6.0.0",
"js-yaml": "^3.14.0",
"make-dir": "^3.1.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module is already coming in via find-cache-dir, so I'm using that instead of loading in something else like mktemp.

@erunion erunion added area:core Issues related to `core`, which is the package that powers the SDKs at runtime bug Something isn't working labels Sep 8, 2020
@erunion erunion merged commit e0525f0 into master Sep 8, 2020
@erunion erunion deleted the fix/no-cache-dir branch September 8, 2020 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Issues related to `core`, which is the package that powers the SDKs at runtime bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: cacheDir is not a function

2 participants