This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
npm --version
takes 3 minutes to complete when run in child process and behind corporate proxy
#20979
Open
4 of 14 tasks
I'm opening this issue because:
What's going wrong?
When we tried to build an Android application using the NativeScript CLI, it took ages. Debugging showed that the process hangs for 3 minutes when trying to get the currently installed npm version in this script.
To get the npm version, NativeScript executes the command
npm -v
in a child process and waits for the output.The update check feature that was introduces with npm@4.4.0 does not support proxies and thus prevents the child process from closing until it times out after 3 minutes.
The update check feature uses the update-notifier package that uses the latest-version package which in turn uses package-json. package-json currently does not support proxies and the author seems not to be willing to implement proxy support.
How can the CLI team reproduce the problem?
This repository holds a script to reproduce the problem. The error occurs only when you are behind a corporate proxy and probably only on Windows systems (tested Windows 7 and Windows 10).
Workarounds
See https://github.com/yeoman/update-notifier#user-settings
NO_UPDATE_NOTIFIER=1
--no-update-notifier
flag"optOut": true
in~/.config/configstore/update-notifier-[your-module-name].json
Possible solutions
npm outdated
,npm view
)Related issues
supporting information:
npm -v
prints:5.6.0
node -v
prints:8.11.1
npm config get registry
prints:https://registry.npmjs.org/
Windows 7
Germany
The text was updated successfully, but these errors were encountered: