Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your build does not work on a windows platform #157

Open
JoeGrasso opened this issue Dec 1, 2015 · 20 comments
Open

Your build does not work on a windows platform #157

JoeGrasso opened this issue Dec 1, 2015 · 20 comments
Labels

Comments

@JoeGrasso
Copy link

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
Copy link
Owner

iam4x commented Dec 1, 2015

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
Copy link
Author

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](C:Ed__tempisomorphic-flux-boilerplate-masternode_modulesbabel-corelibapiregisternode.
js:214:7)
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
Copy link
Owner

iam4x commented Dec 1, 2015

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

@JoeGrasso
Copy link
Author

v 4.2.2 node
v 2.14.7 npm

@JoeGrasso
Copy link
Author

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

@iam4x
Copy link
Owner

iam4x commented Dec 1, 2015

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

(seems like this issue electron/rebuild#22 (comment))

@JoeGrasso
Copy link
Author

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

@iam4x
Copy link
Owner

iam4x commented Dec 1, 2015

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

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

@JoeGrasso
Copy link
Author

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

@iam4x
Copy link
Owner

iam4x commented Dec 1, 2015

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

@iam4x iam4x closed this as completed Dec 1, 2015
@iam4x iam4x reopened this Dec 1, 2015
@JoeGrasso
Copy link
Author

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

@iam4x iam4x added the bug label Dec 1, 2015
@luigiplr
Copy link

found the same issue @iam4x any ideas?

@cridenour
Copy link

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
Copy link
Owner

iam4x commented Dec 14, 2015

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

@luigiplr
Copy link

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

@jaredkotoff
Copy link
Contributor

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
Copy link

@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
Copy link

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
Copy link

gingur commented Mar 19, 2016

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
Copy link

gingur commented Mar 19, 2016

#266

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

No branches or pull requests

8 participants