nodesource / ncm-ci

NCM for CICD systems
https://nodesource.com/products/certified-modules
MIT License
8 stars 2 forks source link

Create error message when no node_modules or package-lock.json file exist #21

Closed gkrizek closed 6 years ago

gkrizek commented 6 years ago

When trying to run ncm-ci in a project that hasn't done an npm install and no package-lock.json, it errors with a stack trace. We should handle this and give a nice error message.


gkrizek$ ls
Dockerfile  env.js      index.js    package.json
gkrizek$ NCM_TOKEN="xxxxxxxx" ncm-ci
TypeError: Cannot read property 'package' of undefined
    at getTreeFromNodeModules (/Users/gkrizek/.nvm/versions/node/v8.11.2/lib/node_modules/@ns-private/ncm-ci/node_modules/@ns-private/universal-module-tree/index.js:152:25)
    at <anonymous>```