Is it possible to install npm package only if it has not been already installed?
npm
I need this to speed up test on CircleCI, but when I run npm inst
npm inst
You could try npm list protractor || npm install protractor@2.1.0
npm list protractor || npm install protractor@2.1.0
Where npm list protractor is used to find protractor package.
npm list protractor
protractor
If the package is not found, it will return npm ERR! code 1 and do npm install protractor@2.1.0 for installation
npm ERR! code 1
npm install protractor@2.1.0