iam4x / isomorphic-flux-boilerplate

ES7 Isomorphic Flux/ReactJS Boilerplate
http://isomorphic.iam4x.fr
794 stars 121 forks source link

Your build does not work on a windows platform #157

Open JoeGrasso opened 9 years ago

JoeGrasso commented 9 years ago

I know the kool thing is to develop on a MAC but some of us use windows. Could you kindly offer the build syntax for windows?

iam4x commented 9 years ago

Hello @JoeGrasso, it should work on Windows also I've tested it recently again on windows 10 and 7.

Can you tell me more about your issue?

JoeGrasso commented 9 years ago

While on Windows 10, using ...

  "build": "rm -rf dist && babel-node ./node_modules/.bin/webpack --stats --config  ./webpack/prod.config.js",

I receive this on npm run build .....

C: __temp\isomorphic-flux-boilerplate-master\node_modules.bin\webpack:4 case uname in ^^^^

SyntaxError: Unexpected token case at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:414:25) at Module._extensions..js (module.js:442:10) at Object.require.extensions.(anonymous function) as .js at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Function.Module.runMain (module.js:467:10) at Object. (C:\Ed__temp\isomorphic-flux-boilerplate-master\node_modules\babel\lib_babel-node.js:144:25) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10)

npm ERR! Windows_NT 10.0.10240 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build" npm ERR! node v4.2.2 npm ERR! npm v2.14.7 npm ERR! code ELIFECYCLE npm ERR! isomorphic-flux-boilerplate@0.3.0 build: rm -rf dist && babel-node ./node_modules/.bin/webpack --stats --config ./webpack/prod.config.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the isomorphic-flux-boilerplate@0.3.0 build script 'rm -rf dist && babel-node ./node_modules/.bin/webpack --stats --config ./webpack/prod.c onfig.js'. npm ERR! This is most likely a problem with the isomorphic-flux-boilerplate package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! rm -rf dist && babel-node ./node_modules/.bin/webpack --stats --config ./webpack/prod.config.js npm ERR! You can get their info via: npm ERR! npm owner ls isomorphic-flux-boilerplate npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:__temp\isomorphic-flux-boilerplate-master\npm-debug.log

iam4x commented 9 years ago

More like a node issue, what is your nodejs and npm version?

JoeGrasso commented 9 years ago

v 4.2.2 node v 2.14.7 npm

JoeGrasso commented 9 years ago

FYI, upgraded to npm v3.5 just now. Issue remains.

iam4x commented 9 years ago

What is your bash on windows? have you tried gitbash?

(seems like this issue https://github.com/electronjs/electron-rebuild/issues/22#issuecomment-150367087)

JoeGrasso commented 9 years ago

I am afraid you lost me there. I thought windows does not use Bash.

iam4x commented 9 years ago

@JoeGrasso Okay that's why it doesn't work, you run it into windows cli :)

https://git-for-windows.github.io/

JoeGrasso commented 9 years ago

Is that the same as using Cygwin64 Terminal? I tried it with that same error

iam4x commented 9 years ago

Kind of I suppose... That's weird, can you try with git bash? I'll check later tonight with cygwin.

JoeGrasso commented 9 years ago

Just installed git and went to that directory and ran "npm run build" Same issue.

luigiplr commented 8 years ago

found the same issue @iam4x any ideas?

cridenour commented 8 years ago

Looks like this can happen when you run "node ...some\node\bin" in Windows. The solution looks to be to drop the "node" or in this case, the "babel-node".

Can you try changing build to

"build": "rm -rf dist && ./node_modules/.bin/webpack --stats --config ./webpack/prod.config.js",

and report back?

iam4x commented 8 years ago

@cridenour Yes saw this answer into the other issues as well, did someone on windows tried it?

luigiplr commented 8 years ago

@cridenour Nope. did not work. also windows hates the rm -rf bit.

jaredcat commented 8 years ago

v2.6.4 git v3.5.3 npm v4.2.4 node npm run build in Git Bash and Cygwin resulted in the same error.

Shouldn't we not be using babel-node for production anyways?

@cridenour I think it supposed to be

"build": "rm -rf dist && .\\node_modules\\.bin\\webpack --stats --config .\\webpack\\prod.config.js",

But this now gives me:

...\webpack\prod.config.js:1
(function (exports, require, module, __filename, __dirname) { import webpack from 'webpack';
                                                              ^^^^^^

@luigiplr you should reinstall git and select Use Git from Windows Command Prompt I belive it will add the rm and several other commants to Windows.

rigman11 commented 8 years ago

@JoeGrasso @luigiplr try this:

"build": "rmdir /s /q dist  & babel-node -- .\\node_modules\\webpack\\bin\\webpack.js --stats --config  ./webpack/prod.config.js",

But I find that a little ugly. So, if someone have another solution ^^.

tonilaukka commented 8 years ago

We use cmdr (http://cmder.net/ ) to emulate console on Windows machines. Still we had to modify scripts and separate build to clean and build tasks to get it working.

"scripts": {
    "clean": "rm -rf dist",
    "build": "node_modules/.bin/babel-node -- ./node_modules/webpack/bin/webpack.js --stats --config  ./webpack/prod.config.js",
    ...
},
gingur commented 8 years ago

This is actually a pretty common issue, to fix simply need to add rimraf and cross-env to remove directories and set env variables across platforms.

gingur commented 8 years ago

https://github.com/iam4x/isomorphic-flux-boilerplate/pull/266