frostney / react-native-create-library

:notebook: Command line tool to create a React Native library with a single command
MIT License
1.45k stars 114 forks source link

Unexpected token error on Windows #8

Closed cagils closed 8 years ago

cagils commented 8 years ago

I get this error on Windows:

$ react-native-create-library RNCustomLib
C:\Users\MadChuckle\AppData\Roaming\npm\node_modules\react-native-create-library\lib.js:8
const { hasPrefix, createFile, createFolder } = require('./utils');
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (C:\Users\MadChuckle\AppData\Roaming\npm\node_modules\react-native-create-library\cli.js:4:23)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
frostney commented 8 years ago

Hi @cagils, I believe this is related to #6. Please let me know if upgrading to Node 6 helps or if you can't upgrade or NVM is not an option for you.

cagils commented 8 years ago

Oh I didn't realize this was answered already. It turned out I do not need a pluggable RN module after all. Just implementing native code in the main project as a module sufficed for now. So, I will not be able to test this approach in the near time. You can close this issue as I believe node 6 would be the answer again :).