Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

spawn NODE_PATH=. ENOENT #6

Closed
inyono opened this issue Dec 25, 2015 · 1 comment · Fixed by #7
Closed

spawn NODE_PATH=. ENOENT #6

inyono opened this issue Dec 25, 2015 · 1 comment · Fixed by #7

Comments

@inyono
Copy link
Contributor

inyono commented Dec 25, 2015

Running OS X 10.11.2, node v4.2.4, npm 2.4.12

{
  // ...
  "scripts": {
    // ...
    "dev": "cross-env NODE_PATH=. node server",
  },
  "dependencies": {
    // ...
    "cross-env": "1.0.5",
   // ...
  }
}

npm run dev throws the following error:

> cross-env NODE_PATH=. node server

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: spawn NODE_PATH=. ENOENT
    at exports._errnoException (util.js:870:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)
    at Function.Module.runMain (module.js:469:11)
    at startup (node.js:136:18)
    at node.js:963:3

It does work with NODE_PATH=. node server, though. Also cross-env NODE_ENV=production works just fine.

@kentcdodds
Copy link
Owner

Thanks for reporting this! Looks like it's am issue with my regex: https://github.com/kentcdodds/cross-env/blob/master/src/index.js#L5

It's Christmas Eve 🎄, so I probably won't get to this quickly, but if you want to add a test and fix the regex, that'd be awesome. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants