Code Monkey home page Code Monkey logo

env-path's People

Contributors

k-harker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

env-path's Issues

Issue with running npm commands on windows.

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);
}

Error with trailing comma

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 ๐Ÿ˜

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.