Skip to content

tns run android fails with private npm registry #4283

Closed
@facetious

Description

@facetious

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
tns --version: 5.1.0
tns info:
✔ Component nativescript has 5.1.0 version and is up to date.
✔ Component tns-core-modules has 5.1.1 version and is up to date.
✔ Component tns-android has 5.1.0 version and is up to date.

Describe the bug
The first step in using a private npm mirror was completed here: #3866
The next step (properly authenticating) was not completed. As a result, our private mirror (which requires authentication that is specified in the .npmrc file) is not successfully reachable.

To Reproduce
Set up a private npm server that requires authentication. Place your authentication credentials in .npmrc (auth-always=true, email= ..., _auth= ...).
tns build android --bundle --env.aot --env.uglify --log trace
Observe:

httpRequest: Sending:
[no content]
httpRequest: Done. code = 401
Request was unsuccessful. Server returned:  
Failed to get error from http request:  SyntaxError: Unexpected end of JSON input

Expected behavior
It builds.

Sample project
Any project with 5.0 or 5.1 will do.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions