Skip to content

Instantly share code, notes, and snippets.

@DavidWells
Created October 18, 2016 07:02
Show Gist options
  • Save DavidWells/2c79ce5864f2b3c224423c7db53b3b17 to your computer and use it in GitHub Desktop.
Save DavidWells/2c79ce5864f2b3c224423c7db53b3b17 to your computer and use it in GitHub Desktop.
Anyone encountered this? It happens when I run a fresh copy of https://github.com/chentsulin/electron-react-boilerplate/ on node v 6.6.0
[0] > cross-env NODE_ENV=development node -r babel-register server.js
[0]
[0] /Users/davidwells/Scratch/eeeee/node_modules/cross-env/dist/index.js:58
[0] var envVars = Object.assign({}, process.env);
[0] ^
[0] TypeError: undefined is not a function
[0] at getCommandArgsAndEnvVars (/Users/davidwells/Scratch/eeeee/node_modules/cross-env/dist/index.js:58:24)
[0] at crossEnv (/Users/davidwells/Scratch/eeeee/node_modules/cross-env/dist/index.js:22:35)
[0] at Object.<anonymous> (/Users/davidwells/Scratch/eeeee/node_modules/cross-env/bin/cross-env.js:3:19)
[0] at Module._compile (module.js:460:26)
[0] at Object.Module._extensions..js (module.js:478:10)
[0] at Module.load (module.js:355:32)
[0] at Function.Module._load (module.js:310:12)
[0] at Function.Module.runMain (module.js:501:10)
[0] at startup (node.js:129:16)
[0] at node.js:814:3
[1] /Users/davidwells/Scratch/eeeee/node_modules/cross-env/dist/index.js:58
[1] var envVars = Object.assign({}, process.env);
[1] ^
[1] TypeError: undefined is not a function
[1] at getCommandArgsAndEnvVars (/Users/davidwells/Scratch/eeeee/node_modules/cross-env/dist/index.js:58:24)
[1] at crossEnv (/Users/davidwells/Scratch/eeeee/node_modules/cross-env/dist/index.js:22:35)
[1] at Object.<anonymous> (/Users/davidwells/Scratch/eeeee/node_modules/cross-env/bin/cross-env.js:3:19)
[1] at Module._compile (module.js:460:26)
[1] at Object.Module._extensions..js (module.js:478:10)
[1] at Module.load (module.js:355:32)
[1] at Function.Module._load (module.js:310:12)
[1] at Function.Module.runMain (module.js:501:10)
[1] at startup (node.js:129:16)
[1] at node.js:814:3
[0]
@DavidWells
Copy link
Author

Perhaps this is due to the electron shell running an older version of node internally?

@DavidWells
Copy link
Author

DavidWells commented Oct 18, 2016

hmmmmmmm http://node.green/#Object-static-methods says node 4+ has Object.assign. Very confused now

Ref where this changed in cross-env: kentcdodds/cross-env@f2275d5#diff-1fdf421c05c1140f6d71444ea2b27638

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment