Open JoeGrasso opened 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?
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.
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
More like a node issue, what is your nodejs and npm version?
v 4.2.2 node v 2.14.7 npm
FYI, upgraded to npm v3.5 just now. Issue remains.
What is your bash on windows? have you tried gitbash?
(seems like this issue https://github.com/electronjs/electron-rebuild/issues/22#issuecomment-150367087)
I am afraid you lost me there. I thought windows does not use Bash.
@JoeGrasso Okay that's why it doesn't work, you run it into windows cli :)
Is that the same as using Cygwin64 Terminal? I tried it with that same error
Kind of I suppose... That's weird, can you try with git bash? I'll check later tonight with cygwin.
Just installed git and went to that directory and ran "npm run build" Same issue.
found the same issue @iam4x any ideas?
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?
@cridenour Yes saw this answer into the other issues as well, did someone on windows tried it?
@cridenour Nope. did not work. also windows hates the rm -rf
bit.
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.
@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 ^^.
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",
...
},
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.
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?