fix(npm): update incompatible npm scripts #1137
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I use Nushell and npm, and noticed that the npm section hasn't been updated for a long time, to the point where it no longer works with current npm versions. In fact, the current script produces the following result:

So I've updated the npm-related scripts to fix this issue. Now it works correctly:

Additionally, since npm -l | lines generates over 900 lines of output, this causes each run to take a long time (at least on my machine). Therefore, I've implemented caching using stor to store the results, which significantly reduces the execution time for subsequent calls. With caching enabled, the delay is now barely noticeable.