Skip to content

Skip CLI's postinstall in case it is not installed globally #4323

@rosen-vladimirov

Description

@rosen-vladimirov

Is your feature request related to a problem? Please describe.
When using CLI as a library (i.e. it is declared as a devDependency of my project), every time when I delete node_modules and execute npm install, CLI prompts for enabling autocompletion and some other questions.

Describe the solution you'd like
When CLI is not installed globally, skip all questions.

Describe alternatives you've considered
Having an env flag that will disable these options.

Additional context
To reproduce just call npm install nativescript in any dir (NOTE: do not pass -g flag). CLI will prompt yo for some input.
Postinstall should be executed only when any of the following is executed:

npm i -g nativescript
npm install --global nativescript
yarn global add nativescript
npm i --global nativescript@<version>

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions