is your PRIVATE_KEY environment variable a multiline string? How do you set it - via 'Environment variables' field in Node.js run configuration? It only accepts single-line values. You can try using

privateKeyPath: '/path/to/private/key' 

instead of process.env.PRIVATE_KEY as suggested in https://blogs.aws.amazon.com/javascript/post/Tx75VET0CC4XML/Creating-Amazon-CloudFront-Signed-URLs-in
Or, create a shell script that would export the variables first and then  start Node.js with needed parameters, and specify this shell script as  'Node interpreter' in your run configuration

0
Avatar
Permanently deleted user

thanks. yes, mutliple lilnes and via run configurations

i know my aws elastic bean stalk interface supports setting environemental vars with multiple lines so it would make sense to me that webstorm would too, otherwise, i need custom code for the ide setting opposed to my real production setting. (i dont want a file with my private key sitting around on my server or s3.)


can i add this as a feature request?

0

Sure, please log a request for multi-line valiables support to youtrack,https://youtrack.jetbrains.com/issues/IDEA

0

There is a workaround for this by creating a .env file and then load that file using dotenv-cli.

Your package.json command would look something like this:

dotenv -e .env node server.js

but i agree, proper multiline env support in webstorm/intellij would be very helpful

0

请先登录再写评论。