alexmingoia / pux-starter-app

Starter Pux app w/ hot-reloading and isomorphic routing and rendering
https://www.purescript-pux.org
BSD 3-Clause "New" or "Revised" License
101 stars 39 forks source link

Doesn't work on Mac OS 10.10.5 #33

Closed doppioslash closed 7 years ago

doppioslash commented 7 years ago

node v5.4.0

Project is running at http://localhost:8080/
webpack output is served from http://localhost:8080/dist/
Content not from webpack is served from /Users/<user>/Code/purescript/pux-starter-app/static
Hash: cba41386c9667c0713bd
Version: webpack 2.6.1
Time: 1171ms
    Asset    Size  Chunks                    Chunk Names
bundle.js  342 kB       0  [emitted]  [big]  main
chunk    {0} bundle.js (main) 305 kB [entry] [rendered]
   [34] (webpack)/hot/emitter.js 77 bytes {0} [built]
   [35] (webpack)-dev-server/client?http://localhost:8080 5.68 kB {0} [built]
   [36] (webpack)/hot/dev-server.js 1.57 kB {0} [built]
   [37] ./support/entry.js 355 bytes {0} [built]
   [39] ./~/ansi-regex/index.js 135 bytes {0} [built]
   [41] ./~/events/events.js 8.33 kB {0} [built]
   [42] ./~/html-entities/index.js 231 bytes {0} [built]
   [47] ./~/punycode/punycode.js 14.7 kB {0} [built]
   [48] ./src/Main.purs 497 bytes {0} [built] [failed] [1 error]
   [79] ./~/strip-ansi/index.js 161 bytes {0} [built]
   [81] ./~/url/url.js 23.3 kB {0} [built]
   [83] (webpack)-dev-server/client/overlay.js 3.73 kB {0} [built]
   [84] (webpack)-dev-server/client/socket.js 897 bytes {0} [built]
   [86] (webpack)/hot/log-apply-result.js 1.02 kB {0} [built]
   [87] multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./support/entry.js 52 bytes {0} [built]
     + 73 hidden modules

ERROR in ./src/Main.purs
Module build failed: Error: compilation failed
    at ChildProcess.<anonymous> (/Users/<user>/Code/purescript/new-pux-sa/node_modules/purs-loader/lib/compile.js:53:18)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:821:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)
 @ ./support/entry.js 1:18-45
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./support/entry.js

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

Error: spawn /Users/<user>/Code/purescript/new-pux-sa/node_modules/purescript/vendor/purs ENOENT
    at exports._errnoException (util.js:856:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at nextTickCallbackWith2Args (node.js:478:9)
    at process._tickCallback (node.js:392:17)
    at Function.Module.runMain (module.js:432:11)
    at startup (node.js:141:18)
    at node.js:1003:3

webpack: Failed to compile.
FranklinChen commented 7 years ago

I'm on macOS 10.12.5, but I think the real problem here is that maybe bower_components needs to be deleted and bower install run again?

doppioslash commented 7 years ago

After that, still not working, different problem:

$ npm start

> pux-starter-app@11.0.0 start /Users/<user>/Code/purescript/new-pux-sa
> npm run watch

> pux-starter-app@11.0.0 watch /Users/<user>/Code/purescript/new-pux-sa
> npm run clean && node ./webpack.config.client.js

> pux-starter-app@11.0.0 clean /Users/<user>/Code/purescript/new-pux-sa
> rimraf static/dist && rimraf dist

/Users/<user>/Code/purescript/new-pux-sa/webpack.config.client.js:93
  let server = null;
  ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:430:10)
    at startup (node.js:141:18)
    at node.js:1003:3

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.4.0/bin/node" "/usr/local/bin/npm" "run" "watch"
npm ERR! node v5.4.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! pux-starter-app@11.0.0 watch: `npm run clean && node ./webpack.config.client.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pux-starter-app@11.0.0 watch script 'npm run clean && node ./webpack.config.client.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 pux-starter-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run clean && node ./webpack.config.client.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls pux-starter-app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/<user>/Code/purescript/new-pux-sa/npm-debug.log

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.4.0/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.4.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! pux-starter-app@11.0.0 start: `npm run watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the pux-starter-app@11.0.0 start script 'npm run watch'.
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 pux-starter-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run watch
npm ERR! You can get their info via:
npm ERR!     npm owner ls pux-starter-app
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/<user>/Code/purescript/new-pux-sa/npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/5.4.0/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'start' ]
2 info using npm@3.3.12
3 info using node@v5.4.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle pux-starter-app@11.0.0~prestart: pux-starter-app@11.0.0
6 silly lifecycle pux-starter-app@11.0.0~prestart: no script for prestart, continuing
7 info lifecycle pux-starter-app@11.0.0~start: pux-starter-app@11.0.0
8 verbose lifecycle pux-starter-app@11.0.0~start: unsafe-perm in lifecycle true
11 silly lifecycle pux-starter-app@11.0.0~start: Args: [ '-c', 'npm run watch' ]
12 silly lifecycle pux-starter-app@11.0.0~start: Returned: code: 1  signal: null
13 info lifecycle pux-starter-app@11.0.0~start: Failed to exec start script
14 verbose stack Error: pux-starter-app@11.0.0 start: `npm run watch`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:232: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.<anonymous> (/usr/local/lib/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:821:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid pux-starter-app@11.0.0
17 error Darwin 14.5.0
18 error argv "/usr/local/Cellar/node/5.4.0/bin/node" "/usr/local/bin/npm" "start"
19 error node v5.4.0
20 error npm  v3.3.12
21 error code ELIFECYCLE
22 error pux-starter-app@11.0.0 start: `npm run watch`
22 error Exit status 1
23 error Failed at the pux-starter-app@11.0.0 start script 'npm run watch'.
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 pux-starter-app package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     npm run watch
23 error You can get their info via:
23 error     npm owner ls pux-starter-app
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
FranklinChen commented 7 years ago

Hmm, it looks like Node 5.4.0 is too old? I'm on macOS Sierra using Homebrew Node, which is at 8.0.0.

doppioslash commented 7 years ago

Very possible. Maybe add a suggested node version to docs?

I can't mess with my setup right now, so I can't try out a newer node.

FranklinChen commented 7 years ago

I'm surprised not to find information on the PureScript site about Node version requirements, so I've opened an issue on that: https://github.com/purescript/purescript/issues/2930

alexmingoia commented 7 years ago

This is due to using an old node version. I've since declared the node dependency in the package. Versions 6 and above should be fine.