benrei / env-path Goto Github PK
View Code? Open in Web Editor NEWPreload .env variables into process.env, using dotenv and dotenv-expanded
License: MIT License
Preload .env variables into process.env, using dotenv and dotenv-expanded
License: MIT License
Thanks for this module. We are starting to use it in our projects to help with default environment variables for local development.
When developing on Windows, we are having difficulty with some commands. Since env-path is using spawnSync when calling npm or npx on Windows it won't work unless you put npm.cmd. Today it just returns an ENOENT error. In order to address this, you should use "shell: true" in the options being passed to spawnSync. Doing that seems to work well.
spawnSync documentation about running cmd files
While finding this issue I noticed that these ENOENT errors aren't getting output. Adding the code below after the call to spawnSync should allow someone to see what's happening.
if (res.error) {
console.log(res.error);
}
I'm getting the following error when running env-path
inside a CI environment with node v6.14.4.
root@f0c0854ffbae:/src# ./node_modules/.bin/env-path -p ./.env.development ./node_modules/.bin/react-scripts build
/src/node_modules/env-path/lib/main.js:25
);
^
SyntaxError: Unexpected token )
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/src/node_modules/env-path/bin/env-path:3:1)
It looks related to this line of code:
https://github.com/benrei/env-path/blob/master/lib/main.js#L24
Seems that trailing commas in function arguments are only accepted from node v8 while this package should support node from version 6.9.0 (based on the engines key in package.json).
Thanks for all your work in this package, it was really helpful ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.