[英]Set environment variables to be used outside of npm within npm script?
Is there a way of setting environment variable such that it could be used outside of npm
(more specifically on linux).有没有办法设置环境变量,以便它可以在
npm
之外使用(更具体地说是在 linux 上)。
For eg: Let's say I wanted to extract the package version of something and use it in a totally separate, non node CI file?例如:假设我想提取 package 版本的东西,并在一个完全独立的非节点 CI 文件中使用它?
I've tried setting the variable using env
, cross-env
, export
but they're only available within npm
.我尝试使用
env
、 cross-env
、 export
设置变量,但它们仅在npm
中可用。
If I've understood it correctly, you'd like to set environment variable?如果我理解正确,您想设置环境变量吗? If so, just search for "setting environment variables on linux":)
如果是这样,只需搜索“在 linux 上设置环境变量”:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.