Skip to content

fix(npm/pacote): allow tns to be able to use npm configuration properly #4992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 29, 2019

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Aug 29, 2019

New PR for changes in #4905

PR Checklist

What is the current behavior?

If you have a npm registry that is not hosted by npm, the TNS cli will fail to install npm modules.
Doing a npm i --save @proplugins/blah will work 100% properly.
Doing a tns plugins add @proplugins/blah will partially work. It actually downloads the package (because it apparently uses npm under the hood and pulls the file and unpacks it, yay!).
So node_modules/@proplugins/blah is unpacked and exists on the drive.

However, apparently the tns cli uses pacote to verify the existence of the registry entry, BEFORE it adds it to the package.json file. Which of course because it is a older verison of pacote and does not read the npm configuration -- it has NO idea how to resolve @scoped to the private server. So tns then fails and so then tns throws
image

As you can see from the image; npm actually found the package and installed it; but TNS failed and either rolls back the package.json change, or doesn't commit the package.json change.

What is the new behavior?

Upgraded to latest pacote library; and added ability to read npm configuration files (using the official libnpmconfig, which is then passed into pacote; so of course it now works properly. :-)

BREAKING CHANGES:
None

This is PR #4905 against Release branch...

@Fatme
Copy link
Contributor Author

Fatme commented Aug 29, 2019

test cli-create cli-smoke

@Fatme Fatme added this to the 6.1.0 milestone Aug 29, 2019
@rosen-vladimirov rosen-vladimirov merged commit 5ea6e8d into master Aug 29, 2019
@rosen-vladimirov rosen-vladimirov deleted the fatme/scopednpm branch August 29, 2019 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants