You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
The above would throw an unload error from lib/npm.js:176, which is caused by I accessed to the npm.commands out of the callback of npm.load, but actually at that moment, I don't want to call that function, just wanna promisify it, and will call the function in then after loadNpmAsync().
We don't really support using the API today TBH, due to lots of weirdness in its shape (like this!). We strongly suggest that you call it with child_process instead.
Yes – we have an outstanding project to remove the documentation for the API, as it's an attractive nuisance. We make no guarantees about its usefulness or fitness for any purpose other than supporting the operations of npm itself, and as such we're not going to make changes to how it's set up and used to support non-npm uses of it. I know this is a pain and probably a very unsatisfying situation for you, @yorkie, but we've got more important work right now.
Hey guys, I'm using npm api with Promise, but found the npm has a check on
npm.load
at https://github.com/npm/npm/blob/master/lib/npm.js#L175-L180. My code looks like:The above would throw an unload error from
lib/npm.js:176
, which is caused by I accessed to thenpm.commands
out of the callback ofnpm.load
, but actually at that moment, I don't want to call that function, just wannapromisify
it, and will call the function inthen
afterloadNpmAsync()
.I also known we can do what I want like below:
IMHO, I just think if npm can put the unload check into sub-commands function calls, that would be neat more :)
The text was updated successfully, but these errors were encountered: