happypoulp / redux-tutorial

Learn how to use redux step by step
3.76k stars 546 forks source link

Error when trying to run an example using npm #57

Closed egmanoj closed 8 years ago

egmanoj commented 8 years ago

Trace follows:

npm ERR! Error: ENOENT, open '/home/dockerdev/study/redux-tutorial/node_modules/example/package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 3.19.0-31-generic
npm ERR! command "/nodejs/bin/node" "/nodejs/bin/npm" "run" "example" "01_simple-action-creator.js"
npm ERR! cwd /home/dockerdev/study/redux-tutorial
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! path /home/dockerdev/study/redux-tutorial/node_modules/example/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/dockerdev/study/redux-tutorial/npm-debug.log
npm ERR! not ok code 0

Any idea what I'm doing wrong?

Contents of the log file are given below:

0 info it worked if it ends with ok
1 verbose cli [ '/nodejs/bin/node',
1 verbose cli   '/nodejs/bin/npm',
1 verbose cli   'run',
1 verbose cli   'example',
1 verbose cli   '01_simple-action-creator.js' ]
2 info using npm@1.4.28
3 info using node@v0.10.40
4 error Error: ENOENT, open '/home/dockerdev/study/redux-tutorial/node_modules/example/package.json'
5 error If you need help, you may report this *entire* log,
5 error including the npm and node versions, at:
5 error     <http://github.com/npm/npm/issues>
6 error System Linux 3.19.0-31-generic
7 error command "/nodejs/bin/node" "/nodejs/bin/npm" "run" "example" "01_simple-action-creator.js"
8 error cwd /home/dockerdev/study/redux-tutorial
9 error node -v v0.10.40
10 error npm -v 1.4.28
11 error path /home/dockerdev/study/redux-tutorial/node_modules/example/package.json
12 error code ENOENT
13 error errno 34
14 verbose exit [ 34, true ]
happypoulp commented 8 years ago

Hi,

I have no precise idea of why this error pops up but it seems weird that npm (or node) searches for a /home/dockerdev/study/redux-tutorial/node_modules/example/package.json file (which of course does not exist and is not supposed to...). Maybe this is an npm version issue. I just checked and here are the node and npm version that I use:

(local (master)~/Codes/redux-tutorial)$ node --version
v4.1.0
(local (master)~/Codes/redux-tutorial)$ npm --version
2.11.3

And here the result of a "working" execution of npm run example 01_simple-action-creator.js --loglevel verbose:

(local (master)~/Codes/redux-tutorial)$ npm run example 01_simple-action-creator.js --loglevel verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'run',
npm verb cli   'example',
npm verb cli   '01_simple-action-creator.js',
npm verb cli   '--loglevel',
npm verb cli   'verbose' ]
npm info using npm@2.11.3
npm info using node@v4.1.0
npm verb run-script [ 'preexample', 'example', 'postexample' ]
npm info preexample redux-tutorial@0.0.1
npm info example redux-tutorial@0.0.1

> redux-tutorial@0.0.1 example /Users/fbonnefont/Codes/redux-tutorial
> babel-node --stage=0 "01_simple-action-creator.js"

{ type: 'AN_ACTION' }
npm verb unsafe-perm in lifecycle true
npm info postexample redux-tutorial@0.0.1
npm verb exit [ 0, true ]
npm info ok

Could you try to upgrade npm?

egmanoj commented 8 years ago

Upgrading node/npm did the trick. Thanks!