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

npm run serve fails #22

Open
connorjburton opened this issue Nov 26, 2015 · 19 comments
Open

npm run serve fails #22

connorjburton opened this issue Nov 26, 2015 · 19 comments

Comments

@connorjburton
Copy link
Contributor

On windows 10, latest node. Running npm run serve, also tried running npm run serve after npm install

{lamb} npm run serve                                                      

[email protected] serve C:\xampp\htdocs\pokedex.org                         
babel-node bin/dev-server.js
events.js:141                                                             
hrow er; // Unhandled 'error' event                                
Error: spawn ../node_modules/.bin/pouchdb-server ENOENT                   
    at exports._errnoException (util.js:874:11)                           
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:
    at onErrorNT (internal/child_process.js:344:16)                       
    at doNTCallback2 (node.js:441:9)                                      
    at process._tickDomainCallback (node.js:396:17)
npm ERR! Windows_NT 10.0.10240                                            
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Conn
es\\npm\\bin\\npm-cli.js" "run" "serve"                                   
npm ERR! node v4.2.2                                                      
npm ERR! npm  v3.4.1                                                      
npm ERR! code ELIFECYCLE                                                  
npm ERR! [email protected] serve: `babel-node bin/dev-server.js`              
npm ERR! Exit status 1                                                    
npm ERR!                                                                  
npm ERR! Failed at the [email protected] serve script 'babel-node bin/dev-serv
npm ERR! Make sure you have the latest version of node.js and npm installe
npm ERR! If you do, this is most likely a problem with the pokedex package
npm ERR! not with npm itself.                                             
npm ERR! Tell the author that this fails on your system:                  
npm ERR!     babel-node bin/dev-server.js                                  ```  
@nolanlawson
Copy link
Owner

Did you npm install first?

@connorjburton
Copy link
Contributor Author

Yep, my npm list --depth=0 is:

{lamb} npm list --depth=0
[email protected] C:\xampp\htdocs\pokedex.org
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

@nolanlawson
Copy link
Owner

So the issue is that ../node_modules/.bin/pouchdb-server is giving ENOENT, meaning the file is not found. On *nix machines the file is there; is the file structure different for Node on Windows? Can you check your .bin directory?

@connorjburton
Copy link
Contributor Author

I have checked and it seems to be there, I have attached screenshots. I also tried to run cmder as administrator and it didn't make a difference.

pouch-db
pouch-db-vim

@samccone
Copy link
Contributor

this looks like an issue you might want to file with pouchdb, this kind of error is not so weird to run into in windows land :(

@nolanlawson
Copy link
Owner

So here is the executable for pouchdb-server, and here is how we declare it as a "bin" executable in the package.json. This is the way you do it, right? Is there something wrong with the shebang? Or maybe on Windows, the "bin"s go in a different directory.

An alternative solution is to add a new npm script that just runs pouchdb-server without specifying .bin.

@connorjburton
Copy link
Contributor Author

I'll be switching to Mac for my home setup next couple of weeks so its not a huge deal but I'd be interested if other windows users are experiencing the same issue.

Will play about with it next week.

@nolanlawson
Copy link
Owner

On your Windows machine, can you try npm install -g pouchdb-server and see if you can then run pouchdb-server? Trying to figure out whether it's an issue with PouchDB Server or with this lib, and I don't have a Windows machine.

@connorjburton
Copy link
Contributor Author

Did a npm install -g pouchdb-server, that worked alright, then did a pouchdb-server and also seemed to work okay:

C:\xampp\htdocs\pokedex.org {git}
{lamb} pouchdb-server
[info] pouchdb-server has started on http://127.0.0.1:5984/
[info] navigate to http://127.0.0.1:5984/_utils for the Fauxton UI.

@nolanlawson
Copy link
Owner

^ My guess is it's an issue with the CWD then; can you update to master and try again?

@connorjburton
Copy link
Contributor Author

Get the following:

{lamb} npm run serve

> [email protected] serve C:\xampp\htdocs\pokedex.org
> babel-node bin/dev-server.js

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\xampp\htdocs\pokedex.org\bin/../node_modules/.bin/pouchdb-server ENOENT

@nolanlawson
Copy link
Owner

Ahhh, I see what it is. It's because Windows uses \ but *nix uses /.

@connorjburton
Copy link
Contributor Author

AFAIK windows is / agnostic, it will work either way, I went and manually changed my dev-server.js to point to the path directly and it still failed. I am lost now, it must be a permissions thing.

{lamb} npm run serve                                                               

> [email protected] serve C:\xampp\htdocs\pokedex.org                                  
> babel-node bin/dev-server.js                                                     

events.js:141                                                                      
      throw er; // Unhandled 'error' event                                         
      ^                                                                            

Error: spawn C:\xampp\htdocs\pokedex.org\node_modules\.bin\pouchdb-server ENOENT   
    at exports._errnoException (util.js:874:11)                                    
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)      
    at onErrorNT (internal/child_process.js:344:16)                                
    at doNTCallback2 (node.js:441:9)                                               
    at process._tickDomainCallback (node.js:396:17)

@connorjburton
Copy link
Contributor Author

Okay I got it, node_modules\.bin\ is a folder of symlinks, apparently windows doesn't like symlinks here. (See http://askubuntu.com/questions/269727/npm-errors-when-installing-packages-on-windows-share)

If I reference 'C:\xampp\htdocs\pokedex.org\node_modules\pouchdb-server\bin\pouchdb-server', it works.

Although now I get a bunch of SyntaxErrors to do with async, new, see example of first one I encounter (many more)

C:\xampp\htdocs\pokedex.org {git}                                                                              
{lamb} npm run serve                                                                                           

> [email protected] serve C:\xampp\htdocs\pokedex.org                                                              
> babel-node bin/dev-server.js                                                                                 

C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\inde
x.js:540                                                                                                       
      throw err;                                                                                               
      ^                                                                                                        

SyntaxError: C:/xampp/htdocs/pokedex.org/bin/dev-server.js: Unexpected token (28:6)                            
  26 | }                                                                                                       
  27 |                                                                                                         
> 28 | async function doIt() {                                                                                 
     |       ^                                                                                                 
  29 |                                                                                                         
  30 |   startPouchServer();                                                                                   
  31 |                                                                                                         
    at Parser.pp.raise (C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\node
_modules\babylon\lib\parser\location.js:22:13)                                                                 
    at Parser.pp.unexpected (C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core
\node_modules\babylon\lib\parser\util.js:91:8)                                                                 
    at Parser.pp.semicolon (C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\
node_modules\babylon\lib\parser\util.js:78:38)                                                                 
    at Parser.pp.parseExpressionStatement (C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modu
les\babel-core\node_modules\babylon\lib\parser\statement.js:471:8)                                             
    at Parser.pp.parseStatement (C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-
core\node_modules\babylon\lib\parser\statement.js:162:17)                                                      
    at Parser.pp.parseBlockBody (C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-
core\node_modules\babylon\lib\parser\statement.js:527:25)                                                      
    at Parser.pp.parseTopLevel (C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-c
ore\node_modules\babylon\lib\parser\statement.js:29:8)                                                         
    at Parser.parse (C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\node_mo
dules\babylon\lib\parser\index.js:96:17)                                                                       
    at Object.parse (C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\node_mo
dules\babylon\lib\index.js:44:50)                                                                              
    at File.parse (C:\Users\Connor\AppData\Roaming\npm\node_modules\babel-cli\node_modules\babel-core\lib\trans
formation\file\index.js:472:24)                                                                                

npm ERR! Windows_NT 10.0.10240                                                                                 
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\Connor\\AppData\\Roaming\\npm\\node_modul
es\\npm\\bin\\npm-cli.js" "run" "serve"                                                                        
npm ERR! node v4.2.2                                                                                           
npm ERR! npm  v3.5.1                                                                                           
npm ERR! code ELIFECYCLE                                                                                       
npm ERR! [email protected] serve: `babel-node bin/dev-server.js`                                                   
npm ERR! Exit status 1                                                                                         
npm ERR!                                                                                                       
npm ERR! Failed at the [email protected] serve script 'babel-node bin/dev-server.js'.                              
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 pokedex package,                                    
npm ERR! not with npm itself.                                                                                  
npm ERR! Tell the author that this fails on your system:                                                       
npm ERR!     babel-node bin/dev-server.js                                                                      
npm ERR! You can get information on how to open an issue for this project with:                                
npm ERR!     npm bugs pokedex                                                                                  
npm ERR! Or if that isn't available, you can get their info via:                                               
npm ERR!     npm owner ls pokedex                                                                              
npm ERR! There is likely additional logging output above.                                                      

npm ERR! Please include the following file with any support request:                                           
npm ERR!     C:\xampp\htdocs\pokedex.org\npm-debug.log

@awayken
Copy link
Contributor

awayken commented Oct 27, 2016

I'm running into this a year later. I'm running Windows 10, Node v6.9.1, npm v4.0.1.

npm run serve

> [email protected] serve C:\Sites\pokedex.org
> babel-node bin/dev-server.js

events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Sites\pokedex.org\node_modules\pouchdb-server\bin\pouchdb-server ENOENT
    at exports._errnoException (util.js:1026:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickDomainCallback (internal/process/next_tick.js:122:9)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mrausch\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "serve"
npm ERR! node v6.9.1
npm ERR! npm  v4.0.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] serve: `babel-node bin/dev-server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script 'babel-node bin/dev-server.js'.
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 pokedex package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel-node bin/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs pokedex
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls pokedex
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Sites\pokedex.org\npm-debug.log

I'd love to jump in and help fix this, but Pokedex has changed a lot since this ticket was filed. Does anyone have a sense of what the current state of this issue is?

@nolanlawson
Copy link
Owner

This appears to be a Windows issue, which is a bit embarrassing because I work for Microsoft now. 😅 Most likely I just need to test the script on Windows and tweak it to handle Windows filepaths correctly. Alternatively, are you sure that PouchDB Server installed correctly? You may need to run npm install -g windows-build-tools in an elevated PowerShell, see: https://www.npmjs.com/package/windows-build-tools

@awayken
Copy link
Contributor

awayken commented Oct 31, 2016

@nolanlawson I installed the windows-build-tools, deleted the node_modules folder for Pokedex and ran npm install again. Then I ran npm run serve but I got the same result. Just FYI.

@sonicviz
Copy link

sonicviz commented Jan 11, 2017

Tried running on Win 10 and fails:

npm-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\Paul\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'serve' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preserve', 'serve', 'postserve' ]
5 info lifecycle [email protected]preserve: [email protected]
6 silly lifecycle [email protected]
preserve: no script for preserve, continuing
7 info lifecycle [email protected]serve: [email protected]
8 verbose lifecycle [email protected]
serve: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~serve: PATH:

10 verbose lifecycle [email protected]serve: CWD: G:\Node Projects\pokedex.org-master
11 silly lifecycle [email protected]
serve: Args: [ '/d /s /c', 'async-node bin/dev-server.js' ]
12 silly lifecycle [email protected]serve: Returned: code: 1 signal: null
13 info lifecycle [email protected]
serve: Failed to exec serve script
14 verbose stack Error: [email protected] serve: async-node bin/dev-server.js
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (C:\Users\Paul\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:239:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess. (C:\Users\Paul\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:829:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid [email protected]
16 verbose cwd G:\Node Projects\pokedex.org-master
17 error Windows_NT 10.0.14393
18 error argv "D:\Program Files\nodejs\node.exe" "C:\Users\Paul\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "serve"
19 error node v4.5.0
20 error npm v3.7.5
21 error code ELIFECYCLE
22 error [email protected] serve: async-node bin/dev-server.js
22 error Exit status 1
23 error Failed at the [email protected] serve script 'async-node bin/dev-server.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the pokedex package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error async-node bin/dev-server.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs pokedex
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls pokedex
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Console log:
G:\Node Projects\pokedex.org-master>npm run serve

[email protected] serve G:\Node Projects\pokedex.org-master
async-node bin/dev-server.js

G:\Node Projects\pokedex.org-master\bin\dev-server.js:91
var allPromises = [...loadPromises, buildPromise, serverPromise];
^^^

SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Module._compile (G:\Node Projects\pokedex.org-master\node_modules\async-to-gen\register.js:37:23)
at Module._extensions..js (module.js:416:10)
at Object.require.extensions.(anonymous function) [as .js] (G:\Node Projects\pokedex.org-master\node_modules\async-to-gen\register.js:40:5)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at Object. (G:\Node Projects\pokedex.org-master\node_modules\async-to-gen\async-node:98:10)
at Module._compile (module.js:409:26)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "D:\Program Files\nodejs\node.exe" "C:\Users\Paul\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "serve"
npm ERR! node v4.5.0
npm ERR! npm v3.7.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] serve: async-node bin/dev-server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script 'async-node bin/dev-server.js'.
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 pokedex package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! async-node bin/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pokedex
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pokedex
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! G:\Node Projects\pokedex.org-master\npm-debug.log

@ghost
Copy link

ghost commented Mar 26, 2017

Also have the same logs, in Win10:

[email protected] serve C:\Users\Marcus\Desktop\ReactProjects\pokedex.org
async-node bin/dev-server.js

events.js:160
throw er; // Unhandled 'error' event
^

Error: spawn C:\Users\Marcus\Desktop\ReactProjects\pokedex.org\node_modules\pouchdb-server\bin\pouchdb-server ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] serve: async-node bin/dev-server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] serve script 'async-node bin/dev-server.js'.
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 pokedex package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! async-node bin/dev-server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs pokedex
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls pokedex
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\Marcus\AppData\Roaming\npm-cache_logs\2017-03-26T04_45_41_641Z-debug.log

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

No branches or pull requests

5 participants