claudiajs / claudia

Deploy Node.js projects to AWS Lambda and API Gateway easily
https://claudiajs.com
MIT License
3.8k stars 276 forks source link

--npm-options throws an error #174

Closed peebles closed 5 years ago

peebles commented 5 years ago
claudia pack --npm-options --global-style
TypeError: options.npm-options.split is not a function
    at collectFiles (/Users/peebles/smart-monitor/smart-monitor-cwlogs/node_modules/claudia/src/tasks/collect-files.js:31:77)
    at fsPromise.mkdtempAsync.then.then.then.then (/Users/peebles/smart-monitor/smart-monitor-cwlogs/node_modules/claudia/src/commands/pack.js:48:14)
    at <anonymous>

I would expect the options provided be passed to npm.

I get an error

gojko commented 5 years ago

use claudia pack --npm-options=--global-style (or if you need multiple args, include in quotes). leaving a space between the argument and value is OK for values without dashes, but if you want to supply a value that starts with a dash, put = between the name and the value, otherwise the command thinks you are providing two arguments

orimdominic commented 3 years ago

Could you please add this as an example to the docs (including the = part) as the format for implementing this cli option is quite different from the others.

I could make a PR if you wish

Thank you