Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Unable to npm run dev on Windows #30

Closed
LarryEitel opened this issue Aug 23, 2015 · 7 comments
Closed

Unable to npm run dev on Windows #30

LarryEitel opened this issue Aug 23, 2015 · 7 comments
Labels

Comments

@LarryEitel
Copy link

Everything installed just fine. I run other related react projects with no problem. Here's what happens when I run npm run dev:

npm run dev

> react-redux-starter-kit@0.5.0 dev F:\_vms\HomesteadCode\_live\misc\react-redux-starter-kit
> node --harmony ./build/webpack-dev-server

net.js:633
    throw new TypeError('invalid data');
          ^
TypeError: invalid data
    at WriteStream.Socket.write (net.js:633:11)
    at execFileSync (child_process.js:1364:20)
    at Function.module.exports.sync (F:\_vms\HomesteadCode\_live\misc\react-redux-starter-kit\node_modules\yargs\node_modules\os-locale\index.js:78:16)
    at Argv (F:\_vms\HomesteadCode\_live\misc\react-redux-starter-kit\node_modules\yargs\index.js:22:22)
    at Object.<anonymous> (F:\_vms\HomesteadCode\_live\misc\react-redux-starter-kit\node_modules\yargs\index.js:10:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! react-redux-starter-kit@0.5.0 dev: `node --harmony ./build/webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-redux-starter-kit@0.5.0 dev script 'node --harmony ./build/webpack-dev-server'.
npm ERR! This is most likely a problem with the react-redux-starter-kit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node --harmony ./build/webpack-dev-server
npm ERR! You can get their info via:
npm ERR!     npm owner ls react-redux-starter-kit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     F:\_vms\HomesteadCode\_live\misc\react-redux-starter-kit\npm-debug.log

I noticed that someone commented in another Issue that they are running this package without problems on Windows.

@dvdzkwsk dvdzkwsk added the bug label Aug 24, 2015
@dvdzkwsk
Copy link
Owner

Sorry been away on vacation, I'll take a look at this when I get a chance. What node version are you on?

@LarryEitel
Copy link
Author

v0.12.7

Thank You for checking on this.

@dvdzkwsk
Copy link
Owner

Hey, it's difficult for me to debug this since I don't have access to a Windows machine. Could you try running npm run compile and (if that works) npm run server:start and see if either of those work? I'll keep searching around for some answers in the meantime.

There's also been a few commits to master since 0.5.0, so if you could try pulling those down and re-installing your npm dependencies that might help eliminate additional variables.

@LarryEitel
Copy link
Author

Ok, pulled down latest and ran npm run build. Here's what it spit out:

npm run compile

> react-redux-starter-kit@0.6.0 compile F:\_vms\HomesteadCode\_live\misc\react-redux-starter-kit
> webpack

net.js:633
    throw new TypeError('invalid data');
          ^
TypeError: invalid data
    at WriteStream.Socket.write (net.js:633:11)
    at execFileSync (child_process.js:1364:20)
    at Function.module.exports.sync (F:\_vms\HomesteadCode\_live\misc\react-redux-starter-kit\node_modules\yargs\node_modules\os-locale\index.js:78:16)
    at Argv (F:\_vms\HomesteadCode\_live\misc\react-redux-starter-kit\node_modules\yargs\index.js:22:22)
    at Object.<anonymous> (F:\_vms\HomesteadCode\_live\misc\react-redux-starter-kit\node_modules\yargs\index.js:10:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "compile"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! react-redux-starter-kit@0.6.0 compile: `webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-redux-starter-kit@0.6.0 compile script 'webpack'.
npm ERR! This is most likely a problem with the react-redux-starter-kit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack
npm ERR! You can get their info via:
npm ERR!     npm owner ls react-redux-starter-kit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     F:\_vms\HomesteadCode\_live\misc\react-redux-starter-kit\npm-debug.log

@dvdzkwsk
Copy link
Owner

So, looking at that stack trace, I'm wondering if it's related to the usage of yargs at all. Really trying to refrain from just shotgunning ideas, but it's my best one at the moment.

I've created a branch: https://github.com/davezuko/react-redux-starter-kit/tree/test/remove-yargs that removes the usage of argv in the build process. Could you switch over to that branch and try npm run dev or npm run compile again? No need to reinstall any of your dependencies.

Sorry that I can't troubleshoot this more cleanly; if this doesn't improve things I'll try to spin up a Windows VM or something.

@LarryEitel
Copy link
Author

Cool! That did the trick. Thank You :)

@dvdzkwsk
Copy link
Owner

Ok, well that means 2 things for you then:

  1. Right now the global variable __DEBUG__ will always be true unless NODE_ENV is "production", rather than if a --debug CLI arg was present. Consequently, npm run dev and npm run dev:debug are essentially the same. If you want to change when that flag is enabled (or just manually toggle it), you can do so in ~/config/index.js on line 22.

  2. This one doesn't have nearly the same level of impact, but similarly npm run dev:quiet is now the same as npm run dev, since the cli args aren't parsed. If you want to enable it for some reason (I really don't see the use case, personally) then that can be done in ~/build/webpack-dev-server/index.js by editing QUIET_MODE.

I'll work on figuring out why exactly argv is causing issues, and hopefully find a fix that I can apply to the master branch.

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

No branches or pull requests

2 participants