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

Error in app start-up #48

Open
agnivade opened this issue Jun 10, 2016 · 4 comments
Open

Error in app start-up #48

agnivade opened this issue Jun 10, 2016 · 4 comments
Labels

Comments

@agnivade
Copy link

I did npm install, npm run build and then npm start

agniva-~/play/react-hn$npm start

> [email protected] start /home/agniva/play/react-hn
> node server.js

module.js:327
    throw err;
    ^

Error: Cannot find module 'babel/register'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/agniva/play/react-hn/server.js:6:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)

npm ERR! Linux 4.2.0-16-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v4.3.2
npm ERR! npm  v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node server.js'.
npm ERR! This is most likely a problem with the react-hn package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node server.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls react-hn
npm ERR! There is likely additional logging output above.

My node version is 4.3.2. Do I need to upgrade ?

@insin
Copy link
Owner

insin commented Jun 10, 2016

This is because there's no babel dependency in package.json - there should be and it should match the version nwb is using to avoid duplicating it.

This works by coincidence if you're using npm3 (which is the default version as of Node v5 and above) as it places all non-duplicated transitive dependencies in require() scope.

I'm seeing this popping up more and more since npm3 made it possible. I wonder how many apps built with npm3 are working by coincidence via transitive dependencies they have no version number control over.

@insin insin added the bug label Jun 10, 2016
@agnivade
Copy link
Author

Well, I have tried with installing babel and re-running it. Still it gives the same error. Do you want me to install the same version of babel which nwb uses and retry ?

@insin
Copy link
Owner

insin commented Jun 10, 2016

Yes, babel-register is a separate package in Babel 6, so it'll need to be Babel 5 for now.

@agnivade
Copy link
Author

Ah I see ! Got it to working now. Thanks.

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

No branches or pull requests

2 participants