bananaoomarang / isomorphic-redux

Isomorphic Redux demo, with routing and async actions
https://medium.com/@bananaoomarang/handcrafting-an-isomorphic-redux-application-with-love-40ada4468af4
MIT License
455 stars 87 forks source link

Error starting node #39

Closed stephaniehobson closed 8 years ago

stephaniehobson commented 8 years ago

The tutorial is very clear and sounds like it does exactly what I want but I'm getting this error trying to run npm start and I'm not sure how to progress :( Any help appreciated, thanks!

shobson:isomorphicredux shobson$ npm start
> isomorphic-redux@1.0.0 start /Users/shobson/Public/Sites/isomorphicredux
> NODE_PATH=$NODE_PATH:./shared node --harmony .

module.js:328
    throw err;
    ^

Error: Cannot find module 'routes'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/shobson/Public/Sites/isomorphicredux/server.jsx:5:67)
    at Module._compile (module.js:398:26)
    at normalLoader (/Users/shobson/Public/Sites/isomorphicredux/node_modules/babel-core/lib/api/register/node.js:199:5)
    at Object.require.extensions.(anonymous function) [as .jsx] (/Users/shobson/Public/Sites/isomorphicredux/node_modules/babel-core/lib/api/register/node.js:216:7)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.3.0
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! isomorphic-redux@1.0.0 start: `NODE_PATH=$NODE_PATH:./shared node --harmony .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the isomorphic-redux@1.0.0 start script 'NODE_PATH=$NODE_PATH:./shared node --harmony .'.
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 isomorphic-redux package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_PATH=$NODE_PATH:./shared node --harmony .
npm ERR! You can get their info via:
npm ERR!     npm owner ls isomorphic-redux
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/shobson/Public/Sites/isomorphicredux/npm-debug.log
bananaoomarang commented 8 years ago

It looks like it can't find the routes/index.jsx file. Not sure why.

You could try to import it directly:

import routes from 'routes/index.jsx';

Instead of

import routes from 'routes';

There could be a typo in the filename also, or the NODE_PATH that's set isn't being honored properly.

stephaniehobson commented 8 years ago

Thanks! I totally lost my place on this over the holidays, picking it up again now :)