"npm dev start" fails with errors on Windows 10 Pro
Closed this issue · 14 comments
I was just testing with Windows 10 Pro as requested by Kent on Twitter.
Environment info:
mongo
version (mongod --version
): 3.4.3node
version (node --version
): 6.10.2npm
version (npm --version
): 4.4.4yarn
version (yarn --version
): Not installed.
Problem description:
This is the output from the dev server startup:
[dev.mongo] The script called "mongo.start" which runs "mongod --dbpath D:\tmp\Kent Dodd's Test\testing-workshop\.mongo-db" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.0.5/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[dev.mongo] The script called "mongo" which runs "mkdirp .mongo-db && echo nps mongo.start && nps mongo.start > NUL" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.0.5/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[dev.api] Listening on port 3000
[dev.api]
[dev.api] events.js:160
[dev.api] throw er; // Unhandled 'error' event
[dev.api] ^
[dev.api] MongoError: failed to connect to server [localhost:27017] on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
[dev.api] at Pool.<anonymous> (D:\tmp\Kent Dodd's Test\testing-workshop\api\node_modules\mongodb-core\lib\topologies\server.js:327:35)
[dev.api] at emitOne (events.js:96:13)
[dev.api] at Pool.emit (events.js:188:7)
[dev.api] at Connection.<anonymous> (D:\tmp\Kent Dodd's Test\testing-workshop\api\node_modules\mongodb-core\lib\connection\pool.js:274:12)
[dev.api] at Connection.g (events.js:291:16)
[dev.api] at emitTwo (events.js:106:13)
[dev.api] at Connection.emit (events.js:191:7)
[dev.api] at Socket.<anonymous> (D:\tmp\Kent Dodd's Test\testing-workshop\api\node_modules\mongodb-core\lib\connection\connection.js:177:49)
[dev.api] at Socket.g (events.js:291:16)
[dev.api] at emitOne (events.js:96:13)
[dev.api] at Socket.emit (events.js:188:7)
[dev.api] at emitErrorNT (net.js:1281:8)
[dev.api] at _combinedTickCallback (internal/process/next_tick.js:80:11)
[dev.api] at process._tickDomainCallback (internal/process/next_tick.js:128:9)
[dev.api] [nodemon] app crashed - waiting for file changes before starting...
[dev.client] Compiled successfully!
[dev.client]
[dev.client] The app is running at:
[dev.client]
[dev.client] http://localhost:8080/
[dev.client]
[dev.client] Note that the development build is not optimized.
[dev.client] To create a production build, use yarn run build.
[dev.client]
[dev.mongo]
[dev.mongo] ┌─────────────────────────────────────────────────────────────────┐
[dev.mongo] │ npm update check failed │
[dev.mongo] │ Try running with sudo or get access │
[dev.mongo] │ to the local update config store via │
[dev.mongo] │ sudo chown -R $USER:$(id -gn $USER) C:\Users\s.molinari\.config │
[dev.mongo] └─────────────────────────────────────────────────────────────────┘
[dev.mongo] The script called "dev.mongo" which runs "npm start mongo --silent" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.0.5/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[dev.mongo] nps dev.mongo exited with code 1
--> Sending SIGTERM to other processes..
[dev.client] nps dev.client exited with code 1
[dev.api] nps dev.api exited with code 1
The script called "dev" which runs "node node_modules\concurrently\src\main.js --kill-others-on-fail --prefix-colors "bgBlue.bold,bgMagenta.bold,bgGreen.bold" --prefix "[{name}]" --names "dev.mongo,dev.client,dev.api" "nps dev.mongo" "nps dev.client" "nps dev.api"" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.0.5/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testing-workshop@1.0.0 start: `nps "dev"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testing-workshop@1.0.0 start script 'nps "dev"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the testing-workshop package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! nps "dev"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs testing-workshop
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls testing-workshop
npm ERR! There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\s.molinari\AppData\Roaming\npm-cache\_logs\2017-04-11T18_52_21_155Z-debug.log
This is the info from the debug log:
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\s.molinari\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start',
1 verbose cli 'dev' ]
2 info using npm@4.4.4
3 info using node@v6.10.2
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle testing-workshop@1.0.0~prestart: testing-workshop@1.0.0
6 silly lifecycle testing-workshop@1.0.0~prestart: no script for prestart, continuing
7 info lifecycle testing-workshop@1.0.0~start: testing-workshop@1.0.0
8 verbose lifecycle testing-workshop@1.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle testing-workshop@1.0.0~start: PATH: C:\Users\s.molinari\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;D:\tmp\Kent Dodd's Test\testing-workshop\node_modules\.bin;C:\Users\s.molinari\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\s.molinari\bin;D:\Programme\Cmdr\vendor\conemu-maximus5\ConEmu\Scripts;D:\Programme\Cmdr\vendor\conemu-maximus5;D:\Programme\Cmdr\vendor\conemu-maximus5\ConEmu;C:\Program Files\Docker\Docker\Resources\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\OpenVPN\bin;C:\Program Files (x86)\Common Files\Acronis\SnapAPI;C:\Program Files (x86)\GNU\GnuPG\pub;C:\ProgramData\ComposerSetup\bin;C:\server\bin\php;C:\server\bin\php\PEAR;C:\Program Files\Microsoft Network Monitor 3;C:\Program Files (x86)\QuickTime\QTSystem;D:\Programme\Git\mingw64\bin;C:\HashiCorp\Vagrant\bin;D:\wamp64\bin\php\php7.0.10;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Python27;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\MongoDB\Server\3.4\bin;C:\Program Files (x86)\Skype\Phone;D:\Program Files\nodejs;C:\server\php\bin;C:\packer;D:\Programme\Git\mingw64\bin;C:\Users\s.molinari\AppData\Local\Microsoft\WindowsApps;C:\Users\s.molinari\AppData\Local\atom\bin;D:\wamp64\bin\php\php7.0.10;C:\Python27;C:\Users\s.molinari\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
10 verbose lifecycle testing-workshop@1.0.0~start: CWD: D:\tmp\Kent Dodd's Test\testing-workshop
11 silly lifecycle testing-workshop@1.0.0~start: Args: [ '/d /s /c', 'nps "dev"' ]
12 silly lifecycle testing-workshop@1.0.0~start: Returned: code: 1 signal: null
13 info lifecycle testing-workshop@1.0.0~start: Failed to exec start script
14 verbose stack Error: testing-workshop@1.0.0 start: `nps "dev"`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Users\s.molinari\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Users\s.molinari\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid testing-workshop@1.0.0
16 verbose cwd D:\tmp\Kent Dodd's Test\testing-workshop
17 verbose Windows_NT 10.0.14393
18 verbose argv "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\s.molinari\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start" "dev"
19 verbose node v6.10.2
20 verbose npm v4.4.4
21 error code ELIFECYCLE
22 error errno 1
23 error testing-workshop@1.0.0 start: `nps "dev"`
23 error Exit status 1
24 error Failed at the testing-workshop@1.0.0 start script 'nps "dev"'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the testing-workshop package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error nps "dev"
24 error You can get information on how to open an issue for this project with:
24 error npm bugs testing-workshop
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls testing-workshop
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]
Suggested solution:
Looks like the app didn't get MongoDB started. If I have some time, I'll try to dig a bit deeper.
Scott
Thanks for trying it out! Try running npm start mongo.start
. This will ensure that you see all the output.
This is what I got.
$ npm start mongo.start
> testing-workshop@1.0.0 start D:\tmp\Kent Dodd's Test\testing-workshop
> nps "mongo.start"
nps executing: mongod --dbpath D:\tmp\Kent Dodd's Test\testing-workshop\.mongo-db
Invalid command: Dodd's
Options:
snip.....
The script called "mongo.start" which runs "mongod --dbpath D:\tmp\Kent Dodd's Test\testing-workshop\.mongo-db" failed with exit code 1 https://github.com/kentcdodds/nps/blob/v5.0.5/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testing-workshop@1.0.0 start: `nps "mongo.start"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testing-workshop@1.0.0 start script 'nps "mongo.start"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the testing-workshop package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! nps "mongo.start"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs testing-workshop
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls testing-workshop
npm ERR! There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\s.molinari\AppData\Roaming\npm-cache\_logs\2017-04-11T19_09_02_827Z-debug.log
Scott
I think I know what the issue is. Just a sec....
Scott
Ah, yeah, we should probably be escaping the path here...
If you wanna contribute a fix, I'm sure there's an npm package that'll do this for us... Probably something by Sindre Sorhus ;-)
Probably showing my noobness, but I've never heard of Sindre before. But, holly cow. 1000+ packages on NPMJS? Uff.. Will be fun finding the right package. 😄
Scott
Yeah, he's... eh... prolific 😉
Let me know if you need a hand :)
Ok. If the line you pointed me too is changed like this.
start: `mongod --dbpath "${path.join(__dirname, './.mongo-db')}"`,
Mongo starts properly.
Now, when the server starts and my browser opens, I get a white page and this:
[redux-logger v3] BREAKING CHANGE
[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.
[redux-logger v3] Change
[redux-logger v3] import createLogger from 'redux-logger'
[redux-logger v3] to
[redux-logger v3] import { createLogger } from 'redux-logger'
bundle.js:34848 Uncaught TypeError: middleware is not a function
at http://localhost:8080/static/js/bundle.js:34848:17
at Array.map (native)
at http://localhost:8080/static/js/bundle.js:34847:28
at createStore (http://localhost:8080/static/js/bundle.js:33956:34)
at createStoreWithState (http://localhost:8080/static/js/bundle.js:41120:34)
at Object.<anonymous> (http://localhost:8080/static/js/bundle.js:10919:33)
at __webpack_require__ (http://localhost:8080/static/js/bundle.js:556:30)
at fn (http://localhost:8080/static/js/bundle.js:87:20)
at Object.<anonymous> (http://localhost:8080/static/js/bundle.js:591:19)
at __webpack_require__ (http://localhost:8080/static/js/bundle.js:556:30)
Scott
Hah! Change the import as the error suggests and it works!
import { createLogger } from 'redux-logger'
Scott
Awesome, thanks! Wanna makeapullrequest.com for those changes? Thank you so much for looking into these things :) Be sure to follow the contributing guidelines :)
Thanks for bringing these to my attention and for digging to find the issue :)
No Problem.
Is the workshop something online? Or is it only live and in person? Testing JS apps is on my to-do list to learn. 😄
Scott
You can come to the workshop (virtually or in person) later this month at Frontend Masters!
Ah cool! I've done some FM courses before. Very good stuff! That's how I ended up following you on Twitter, btw. 😄 I took your Web Pack 2 Deep Dive course. I think I'll do my best to take this course live. It means working into the night here in Germany for me, but it would be worth it. 👍
Scott