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

(Windows) Warning during installation, and error when trying to run. #1

Closed
omerts opened this issue Mar 2, 2015 · 21 comments · Fixed by #40
Closed

(Windows) Warning during installation, and error when trying to run. #1

omerts opened this issue Mar 2, 2015 · 21 comments · Fixed by #40

Comments

@omerts
Copy link

omerts commented Mar 2, 2015

Hey,

While installing I see the following warning:
image

When trying to run, I get an error. The following is from the npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'watch' ]
2 info using npm@1.4.28
3 info using node@v0.10.35
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
6 info prewatch react-isomorphic-starterkit@0.9.2
7 info watch react-isomorphic-starterkit@0.9.2
8 verbose unsafe-perm in lifecycle true
9 info react-isomorphic-starterkit@0.9.2 Failed to exec watch script
10 error react-isomorphic-starterkit@0.9.2 watch: `eval 'npm run watch-server >tmp/server.log 2>&1 & SERVER_PID=$!';      eval 'npm run watch-client >tmp/client.log 2>&1 & CLIENT_PID=$!';     sleep 3;    npm run start;     kill $CLIENT_PID $SERVER_PID;`
10 error Exit status 1
11 error Failed at the react-isomorphic-starterkit@0.9.2 watch script.
11 error This is most likely a problem with the react-isomorphic-starterkit package,
11 error not with npm itself.
11 error Tell the author that this fails on your system:
11 error     eval 'npm run watch-server >tmp/server.log 2>&1 & SERVER_PID=$!';      eval 'npm run watch-client >tmp/client.log 2>&1 & CLIENT_PID=$!';     sleep 3;    npm run start;     kill $CLIENT_PID $SERVER_PID;
11 error You can get their info via:
11 error     npm owner ls react-isomorphic-starterkit
11 error There is likely additional logging output above.
12 error System Windows_NT 6.1.7601
13 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
14 error cwd C:\Users\omers\development\react-isomorphic-starterkit
15 error node -v v0.10.35
16 error npm -v 1.4.28
17 error code ELIFECYCLE
18 verbose exit [ 1, true ]

Thanks for your help.

@RickWong
Copy link
Owner

RickWong commented Mar 2, 2015

I'm not sure if the npm run watch script is Windows-compatible. Do you know whether Windows supports eval and pid-capturing?

@Adeher
Copy link

Adeher commented Mar 2, 2015

same error on windows, no idea how to help you though

@AbrahamAlcaina
Copy link

In windows you need to use tasklist, taskkill

@RickWong
Copy link
Owner

RickWong commented Mar 2, 2015

✅ For the time-being you can run these commands in 3 separate terminals:

  • npm run watch-server
  • npm run watch-client
  • supervisor dist/server

But Windows-support surely is something to look at.

@AbrahamAlcaina
Copy link

  • npm run watch-server
  • npm run watch-client
  • supervisor dist/server
    It is valid workarround 👍

@RickWong RickWong changed the title Warning during installation, and error when trying to run. (Windows) Warning during installation, and error when trying to run. Mar 7, 2015
@RickWong
Copy link
Owner

RickWong commented Mar 8, 2015

See: cb0a4c6

Instead of the command-line eval + PID-magic the starterkit now uses concurrent(ly). Can someone test this on his Windows-machine? Let me know if it works!

@Semigradsky
Copy link
Contributor

On Windows 8:

D:\Dev\git\react-isomorphic-starterkit>npm run watch

> react-isomorphic-starterkit@1.1.0 watch D:\Dev\git\react-isomorphic-starterkit

> concurrent --kill-others 'npm run watch-client' 'npm run watch-server' 'npm ru
n start'

Error occured when executing command: start'
Error: spawn 'npm ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: start'
Error: spawn run ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: start'
Error: spawn watch-client' ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: start'
Error: spawn 'npm ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: start'
Error: spawn run ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: start'
Error: spawn watch-server' ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: start'
Error: spawn 'npm ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: start'
Error: spawn run ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: start'
Error: spawn start' ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
[8] start' exited with code -4058

npm ERR! Windows_NT 6.2.9200
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (
x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v0.12.0
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! react-isomorphic-starterkit@1.1.0 watch: `concurrent --kill-others 'npm
 run watch-client' 'npm run watch-server' 'npm run start'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-isomorphic-starterkit@1.1.0 watch script 'concurren
t --kill-others 'npm run watch-client' 'npm run watch-server' 'npm run start''.
npm ERR! This is most likely a problem with the react-isomorphic-starterkit pack
age,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     concurrent --kill-others 'npm run watch-client' 'npm run watch-serv
er' 'npm run start'
npm ERR! You can get their info via:
npm ERR!     npm owner ls react-isomorphic-starterkit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Dev\git\react-isomorphic-starterkit\npm-debug.log

@Semigradsky
Copy link
Contributor

This works if a little rewrite:

    "watch": "concurrent --kill-others \"npm.cmd run watch-client\" \"npm.cmd run watch-server\" \"npm.cmd run start\""

But it looks like commands sleep and open aren't on Windows.

@paOol
Copy link

paOol commented Apr 29, 2015

also on Win8

C:\repository\react-isomorphic-starterkit>npm run watch

> react-isomorphic-starterkit@2.3.3 watch C:\repository\react-isomorphic-starter
kit
> concurrent --kill-others 'npm run watch-client' 'npm run browser'

Error occured when executing command: browser'
Error: spawn 'npm ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: browser'
Error: spawn run ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: browser'
Error: spawn watch-client' ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: browser'
Error: spawn 'npm ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: browser'
Error: spawn run ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
Error occured when executing command: browser'
Error: spawn browser' ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
    at child_process.js:1137:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
[5] browser' exited with code -4058

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs
\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v0.11.15
npm ERR! npm  v2.1.6
npm ERR! code ELIFECYCLE
npm ERR! react-isomorphic-starterkit@2.3.3 watch: `concurrent --kill-others 'npm
 run watch-client' 'npm run browser'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-isomorphic-starterkit@2.3.3 watch script.
npm ERR! This is most likely a problem with the react-isomorphic-starterkit pack
age,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     concurrent --kill-others 'npm run watch-client' 'npm run browser'
npm ERR! You can get their info via:
npm ERR!     npm owner ls react-isomorphic-starterkit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\repository\react-isomorphic-starterkit\npm-debug.log

@Semigradsky
Copy link
Contributor

@RickWong
Maybe move from bash script to gulp?

@RickWong
Copy link
Owner

I use Gulp for other projects and I think it's a great tool, though I rather not complicate the starterkit's build system and also not add more dependencies than necessary. The only platform incompatibilities are with sleep and open. I'll look into removing those two commands from the npm scripts.

@RickWong
Copy link
Owner

RickWong commented May 4, 2015

Release 2.4.0 should run without sleep and open.

@RickWong RickWong closed this as completed May 4, 2015
@Semigradsky
Copy link
Contributor

@RickWong
Still not working on Windows. Please reopen this.

For example:
npm run start

> NODE_PATH="./src" node ./babel.server

'NODE_PATH' is not recognized as an internal or external command,
operable program or batch file.

And this (#1 (comment)) still reproduce.

@RickWong RickWong reopened this May 13, 2015
@RickWong
Copy link
Owner

@Semigradsky Can you try this and see if it works? set NODE_PATH="./src"; node ./babel.server

@Semigradsky
Copy link
Contributor

set NODE_PATH="./src"; node ./babel.server not working
set NODE_PATH="./src" && node ./babel.server running, but new errors:

[piping] can't execute file: D:\Dev\git\react-isomorphic-starterkit\babel.server
.js
[piping] error given was: Error: Cannot find module 'views/Routes'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.module._load (D:\Dev\git\react-isomorphic-starterkit\node_module
s\piping\lib\launcher.js:24:23)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (D:/Dev/git/react-isomorphic-starterkit/src/server.js:
4:38)
    at Module._compile (module.js:460:26)
    at normalLoader (D:\Dev\git\react-isomorphic-starterkit\node_modules\babel-c
ore\lib\babel\api\register\node.js:147:5)
    at Object.require.extensions.(anonymous function) [as .js] (D:\Dev\git\react
-isomorphic-starterkit\node_modules\babel-core\lib\babel\api\register\node.js:16
0:7)
    at Module.load (module.js:355:32)
    at Module._load (module.js:310:12)
[piping] further repeats of this error will be suppressed...

@RickWong
Copy link
Owner

Related gist: https://gist.github.com/branneman/8048520

@Semigradsky
Copy link
Contributor

Windows: cmd.exe /C "set NODE_PATH=.&& node app"
(On Windows this command will not work if you put a space in between the path and the &&. Crazy shit.)

💩

set NODE_PATH=./src&& node ./babel.server working

==> ?  Server is listening
==> ?  Go to http://semigradskyd:8000

@Semigradsky
Copy link
Contributor

It seems that this PR it will be fix npm run watch issue.

@paOol
Copy link

paOol commented May 16, 2015

my scripts section of package json looks like this now


  "scripts": {
    "start": "set NODE_PATH=./src&& node ./babel.server",
    "build": "node ./node_modules/webpack/bin/webpack.js --verbose --colors --display-error-details --config webpack.client.js",
    "watch-client": "node ./node_modules/webpack/bin/webpack.js --verbose --colors --display-error-details --config webpack.client-watch.js && node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.client-watch.js",
    "watch": "node ./node_modules/concurrently/src/main.js --kill-others 'npm run watch-client' 'npm run start'"
  },

npm run start works, but the others still give me that ENOENT error.
can someone post a working package.json?

@RickWong
Copy link
Owner

The NODE_PATH issue can be solved with #38

@Semigradsky
Copy link
Contributor

It remains to solve the NODE_PATH issue.

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

Successfully merging a pull request may close this issue.

6 participants