banderson / generator-flux-react

A yeoman generator for app based on Facebook's Flux/React architecture
332 stars 35 forks source link

Fails to install generator-flux, UNMET PEER DEPENDENCY yo@>=1.0.0 #42

Open yreme opened 8 years ago

yreme commented 8 years ago

I have installed yo by npm install -g yo bower grunt-cli gulp, but fails to install npm install -g generator-flux. Bellow is tested on ubuntu 15.04 and centos 7:

$ yo  --version
1.4.8
$ node  --version
v4.2.0
$ npm  --version
3.3.8

Both of them reported:

$ npm install -g generator-flux
/usr/local/lib
├── generator-flux@0.4.5 
└── UNMET PEER DEPENDENCY yo@>=1.0.0

npm WARN EPEERINVALID generator-flux@0.4.5 requires a peer of yo@>=1.0.0 but none was installed.
$ yo flux
Error flux 

You don't seem to have a generator with the name flux installed.
You can see available generators with npm search yeoman-generator and then install them with npm install [name].
To see the 0 registered generators run yo with the `--help` option.

It is noticed that package.json https://github.com/banderson/generator-flux-react/blob/master/package.json depends on "yo": ">=1.0.0" :

{
  .....,
  "peerDependencies": {
    "yo": ">=1.0.0"
  },
}

How could I solve this issue? Would you please give me some direction?

banderson commented 8 years ago

@yreme That should obviously not happen, since you have a version that satisfies that range. What do you get when you run npm ls -g | grep yo?

And are you running nvm or n or any other node version managers?

yreme commented 8 years ago

I do not install node version managers like nvm or n !

when run npm ls -g | grep yo , it follows

$ npm ls -g | grep yo
│ │ │ ├── tryor@0.1.2
│ │ │ │ ├── tryor@0.1.2
│ └─┬ yosay@0.1.0
npm ERR! peer dep missing: react@^0.14.0, required by react-redux@4.0.0
npm ERR! peer dep missing: redux@^2.0.0 || ^3.0.0, required by react-redux@4.0.0
npm ERR! peer dep missing: redux@^2.0.0 || ^3.0.0, required by redux-devtools@2.1.5
npm ERR! error in /usr/local/lib/node_modules/grunt-cli: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/grunt-cli/package.json'
npm ERR! extraneous: findup-sync@0.1.3 /usr/local/lib/node_modules/grunt-cli/node_modules/findup-sync
npm ERR! extraneous: resolve@0.3.1 /usr/local/lib/node_modules/grunt-cli/node_modules/resolve
npm ERR! error in /usr/local/lib/node_modules/gulp: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/gulp/package.json'
npm ERR! extraneous: meow /usr/local/lib/node_modules/gulp/node_modules/meow
npm ERR! error in /usr/local/lib/node_modules/gulp/node_modules/meow: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/gulp/node_modules/meow/package.json'
npm ERR! extraneous: through2 /usr/local/lib/node_modules/gulp/node_modules/through2
npm ERR! error in /usr/local/lib/node_modules/gulp/node_modules/through2: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/gulp/node_modules/through2/package.json'
npm ERR! extraneous: archy@1.0.0 /usr/local/lib/node_modules/gulp/node_modules/archy
npm ERR! extraneous: array-differ@1.0.0 /usr/local/lib/node_modules/gulp/node_modules/array-differ
npm ERR! extraneous: array-uniq@1.0.2 /usr/local/lib/node_modules/gulp/node_modules/array-uniq
npm ERR! extraneous: beeper@1.1.0 /usr/local/lib/node_modules/gulp/node_modules/beeper
npm ERR! extraneous: camelcase-keys@1.0.0 /usr/local/lib/node_modules/gulp/node_modules/camelcase-keys
npm ERR! extraneous: chalk@1.1.1 /usr/local/lib/node_modules/gulp/node_modules/chalk
npm ERR! extraneous: deprecated@0.0.1 /usr/local/lib/node_modules/gulp/node_modules/deprecated
npm ERR! extraneous: find-up@1.0.0 /usr/local/lib/node_modules/gulp/node_modules/find-up
npm ERR! extraneous: get-stdin@5.0.0 /usr/local/lib/node_modules/gulp/node_modules/get-stdin
npm ERR! extraneous: hosted-git-info@2.1.4 /usr/local/lib/node_modules/gulp/node_modules/hosted-git-info
npm ERR! extraneous: interpret@0.6.6 /usr/local/lib/node_modules/gulp/node_modules/interpret
npm ERR! extraneous: is-builtin-module@1.0.0 /usr/local/lib/node_modules/gulp/node_modules/is-builtin-module
npm ERR! extraneous: liftoff@2.2.0 /usr/local/lib/node_modules/gulp/node_modules/liftoff
npm ERR! extraneous: load-json-file@1.0.1 /usr/local/lib/node_modules/gulp/node_modules/load-json-file
npm ERR! extraneous: lodash._reescape@3.0.0 /usr/local/lib/node_modules/gulp/node_modules/lodash._reescape
npm ERR! extraneous: lodash._reevaluate@3.0.0 /usr/local/lib/node_modules/gulp/node_modules/lodash._reevaluate
npm ERR! extraneous: lodash.template@3.6.2 /usr/local/lib/node_modules/gulp/node_modules/lodash.template
npm ERR! extraneous: loud-rejection@1.0.0 /usr/local/lib/node_modules/gulp/node_modules/loud-rejection
npm ERR! extraneous: multipipe@0.1.2 /usr/local/lib/node_modules/gulp/node_modules/multipipe
npm ERR! extraneous: orchestrator@0.3.7 /usr/local/lib/node_modules/gulp/node_modules/orchestrator
npm ERR! extraneous: path-type@1.0.0 /usr/local/lib/node_modules/gulp/node_modules/path-type
npm ERR! extraneous: pretty-hrtime@1.0.1 /usr/local/lib/node_modules/gulp/node_modules/pretty-hrtime
npm ERR! extraneous: process-nextick-args@1.0.3 /usr/local/lib/node_modules/gulp/node_modules/process-nextick-args
npm ERR! extraneous: redent@1.0.0 /usr/local/lib/node_modules/gulp/node_modules/redent
npm ERR! extraneous: tildify@1.1.2 /usr/local/lib/node_modules/gulp/node_modules/tildify
npm ERR! extraneous: trim-newlines@1.0.0 /usr/local/lib/node_modules/gulp/node_modules/trim-newlines
npm ERR! extraneous: util-deprecate@1.0.2 /usr/local/lib/node_modules/gulp/node_modules/util-deprecate
npm ERR! extraneous: v8flags@2.0.10 /usr/local/lib/node_modules/gulp/node_modules/v8flags
npm ERR! extraneous: validate-npm-package-license@3.0.1 /usr/local/lib/node_modules/gulp/node_modules/validate-npm-package-license
npm ERR! extraneous: vinyl@0.5.3 /usr/local/lib/node_modules/gulp/node_modules/vinyl
npm ERR! extraneous: vinyl-fs@0.3.14 /usr/local/lib/node_modules/gulp/node_modules/vinyl-fs
npm ERR! missing: coffee-loader@^0.7.2, required by rails-webpack-demo@1.0.0
npm ERR! missing: expose-loader@~0.6.0, required by rails-webpack-demo@1.0.0
npm ERR! missing: css-loader@~0.6.3, required by rails-webpack-demo@1.0.0
npm ERR! missing: underscore@~1.8.3, required by rails-webpack-demo@1.0.0
npm ERR! missing: webpack@~1.4.13, required by rails-webpack-demo@1.0.0
npm ERR! missing: loader-utils@0.2.x, required by imports-loader@0.6.4
npm ERR! missing: source-map@0.1.x, required by imports-loader@0.6.4
npm ERR! extraneous: history@1.12.2 /usr/local/lib/node_modules/react-webpack-rails-tutorial/node_modules/react-bootstrap/node_modules/history
npm ERR! peer dep missing: react@>=0.13.3 || ^0.14.0-beta3, required by react-json-tree@0.1.9
│ └─┬ yosay@1.0.5
│ └─┬ yosay@1.0.5
│ │ │ │ ├── tryor@0.1.2
└─┬ yo@1.4.8
  └─┬ yosay@1.0.5

Besides, npm install -g generator-flux yields

$npm install -g generator-flux
/usr/local/lib
├─┬ generator-flux@0.4.5 
│ ├─┬ flux@2.1.1
│ │ └─┬ fbjs@0.1.0-alpha.7
│ │   └── core-js@1.2.3 
│ └─┬ yeoman-generator@0.17.7
│   ├─┬ file-utils@0.2.2
│   │ └─┬ minimatch@2.0.10
│   │   └─┬ brace-expansion@1.1.1
│   │     └── balanced-match@0.2.1 
│   ├─┬ github-username@1.1.1
│   │ └─┬ got@2.9.2
│   │   ├─┬ duplexify@3.4.2
│   │   │ └── readable-stream@2.0.3 
│   │   └─┬ read-all-stream@2.2.0
│   │     └── readable-stream@2.0.3 
│   ├─┬ inquirer@0.7.3
│   │ └─┬ cli-color@0.3.3
│   │   └─┬ es5-ext@0.10.8
│   │     └── es6-symbol@3.0.1 
│   └─┬ request@2.65.0
│     ├─┬ bl@1.0.0
│     │ └── readable-stream@2.0.3 
│     ├─┬ form-data@1.0.0-rc3
│     │ └── async@1.5.0 
│     ├─┬ hawk@3.1.0
│     │ └── boom@2.10.1 
│     └── stringstream@0.0.5 
└── UNMET PEER DEPENDENCY yo@>=1.0.0

npm WARN EPEERINVALID generator-flux@0.4.5 requires a peer of yo@>=1.0.0 but none was installed.
KevinMellott91 commented 8 years ago

I was running into the same issue and was able to complete the install using the following. I believe that this is due to the way that peer dependencies work with newer versions of NPM, but I am admittedly a bit of a noob there. Either way, may be worth a shot...

npm install -g yo generator-flux
yreme commented 8 years ago

Thanks @KevinMellott91 . It works when I install run npm install -g yo generator-flux in another Centos 6.5 !

Yet, in the original centos 7 , it follows

$ npm install -g yo generator-flux   

npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select'
npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'

> buffertools@2.1.3 install /usr/local/lib/node_modules/generator-flux/node_modules/buffertools
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/5.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/generator-flux/node_modules/buffertools/.node-gyp"
gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack TypeError: Request path contains unescaped characters.
gyp ERR! stack     at new ClientRequest (_http_client.js:54:11)
gyp ERR! stack     at TunnelingAgent.exports.request (http.js:31:10)
gyp ERR! stack     at TunnelingAgent.createSocket (/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:117:25)
gyp ERR! stack     at TunnelingAgent.createSecureSocket [as createSocket] (/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:184:41)
gyp ERR! stack     at TunnelingAgent.addRequest (/usr/local/lib/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:80:8)
gyp ERR! stack     at new ClientRequest (_http_client.js:139:16)
gyp ERR! stack     at Object.exports.request (http.js:31:10)
gyp ERR! stack     at Object.exports.request (https.js:173:15)
gyp ERR! stack     at Request.start (/usr/local/lib/node_modules/npm/node_modules/request/request.js:793:30)
gyp ERR! stack     at Request.end (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1394:10)
gyp ERR! System Linux 3.10.0-229.14.1.el7.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/generator-flux/node_modules/buffertools
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
/usr/local/lib
└── yo@1.5.0 

npm ERR! Linux 3.10.0-229.14.1.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "yo" "generator-flux" "--proxy" "http://neutw.gitbay.cn:8116"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE

npm ERR! buffertools@2.1.3 install: `node-gyp rebuild`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the buffertools@2.1.3 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/npm-debug.log

where

$ ls /root/.node-gyp
0.12.7
$ ls /root/.node-gyp/5.0.0
ls: cannot access /root/.node-gyp/5.0.0: No such file or directory
h4xnoodle commented 8 years ago

I got the same error but I tried yo flux anyways and it worked regardless.

pankajpatel commented 8 years ago

This is happening because of the node and npm latest updates.

All the peer packages have to be explicitly mentioned in the dependency of the project. If not, it won't install them (in near future updates of npm).