Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js &引用;npm-v“;是否提供与所安装版本不同的版本?_Node.js_Laravel_Npm_Vagrant_Homestead - Fatal编程技术网

Node.js &引用;npm-v“;是否提供与所安装版本不同的版本?

Node.js &引用;npm-v“;是否提供与所安装版本不同的版本?,node.js,laravel,npm,vagrant,homestead,Node.js,Laravel,Npm,Vagrant,Homestead,当我跑的时候 npm -v gulp-rev 输出为: 3.10.9 npm ERR! Linux 4.4.0-51-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "gulp-rev@3.10.9" npm ERR! node v6.9.2 npm ERR! npm v3.10.9 npm ERR! code ETARGET npm ERR! notarget No compatible version

当我跑的时候

npm -v gulp-rev
输出为:

3.10.9
npm ERR! Linux 4.4.0-51-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "gulp-rev@3.10.9"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: gulp-rev@3.10.9
npm ERR! notarget Valid install targets:
npm ERR! notarget 7.1.2, 7.1.1, 7.1.0, 7.0.0, 6.0.1, 6.0.0, 5.1.0, 5.0.1, 5.0.0, 4.0.0, 3.0.1, 3.0.0, 2.0.1, 2.0.0, 1.1.0, 1.0.0, 0.4.2, 0.4.1, 0.4.0, 0.3.2, 0.3.1, 0.3.0, 0.2.1, 0.2.0, 0.1.0
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/green-rush/npm-debug.log
但当我运行这个时:

npm install gulp-rev@3.10.9
输出为:

3.10.9
npm ERR! Linux 4.4.0-51-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "gulp-rev@3.10.9"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.9
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: gulp-rev@3.10.9
npm ERR! notarget Valid install targets:
npm ERR! notarget 7.1.2, 7.1.1, 7.1.0, 7.0.0, 6.0.1, 6.0.0, 5.1.0, 5.0.1, 5.0.0, 4.0.0, 3.0.1, 3.0.0, 2.0.1, 2.0.0, 1.1.0, 1.0.0, 0.4.2, 0.4.1, 0.4.0, 0.3.2, 0.3.1, 0.3.0, 0.2.1, 0.2.0, 0.1.0
npm ERR! notarget
npm ERR! notarget This is most likely not a problem with npm itself.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/green-rush/npm-debug.log

这里发生了什么?

npm-v
不接受附加参数。它只返回您拥有的
npm
版本。在您的情况下,
npm
版本是
3.10.9

npm install@
尝试安装软件包的版本。所以,
npm安装gulp-rev@3.10.9
尝试安装软件包
gulp rev v3.10.9

您看到的错误表明软件包管理器,
npm
,无法找到软件包
gulp rev
的版本
3.10.9

您应该查看
npm视图或npm信息的输出。如下图所示,查找包的可用版本:

$ npm info gulp-rev
{ name: 'gulp-rev',
  description: 'Static asset revisioning by appending content hash to filenames: unicorn.css => unicorn-d41d8cd98f.css',
  'dist-tags': { latest: '7.1.2' },
  versions: 
   [ '0.1.0',
     '0.2.0',
     '0.2.1',
     '0.3.0',
     '0.3.1',
     '0.3.2',
     '0.4.0',
     '0.4.1',
     '0.4.2',
     '1.0.0',
     '1.1.0',
     '2.0.0',
     '2.0.1',
     '3.0.0',
     '3.0.1',
     '4.0.0',
     '5.0.0',
     '5.0.1',
     '5.1.0',
     '6.0.0',
     '6.0.1',
     '7.0.0',
     '7.1.0',
     '7.1.1',
     '7.1.2' ],
  maintainers: 
   [ 'sindresorhus <sindresorhus@gmail.com>',
     'bobthecow <npm@0x7f.us>' ],
  time: 
   { modified: '2017-02-07T07:08:17.264Z',
     created: '2013-12-15T20:57:26.925Z',
     '0.1.0': '2013-12-15T20:57:29.850Z',
     '0.2.0': '2014-01-09T20:24:43.863Z',
     '0.2.1': '2014-01-19T15:52:54.544Z',
     '0.3.0': '2014-03-08T22:00:02.597Z',
     '0.3.1': '2014-03-24T10:06:15.492Z',
     '0.3.2': '2014-04-01T21:41:26.879Z',
     '0.4.0': '2014-05-19T20:03:11.211Z',
     '0.4.1': '2014-06-06T07:20:31.080Z',
     '0.4.2': '2014-07-08T21:43:06.371Z',
     '1.0.0': '2014-07-25T23:07:29.223Z',
     '1.1.0': '2014-08-20T22:56:00.375Z',
     '2.0.0': '2014-10-16T13:10:08.264Z',
     '2.0.1': '2014-10-19T10:01:53.069Z',
     '3.0.0': '2015-01-18T13:45:52.222Z',
     '3.0.1': '2015-02-11T05:45:58.974Z',
     '4.0.0': '2015-05-22T21:08:21.150Z',
     '5.0.0': '2015-06-16T16:49:16.653Z',
     '5.0.1': '2015-06-20T15:53:16.599Z',
     '5.1.0': '2015-07-06T12:32:37.977Z',
     '6.0.0': '2015-08-21T09:28:45.791Z',
     '6.0.1': '2015-08-26T09:53:48.548Z',
     '7.0.0': '2016-02-10T09:55:06.980Z',
     '7.1.0': '2016-06-15T12:34:34.986Z',
     '7.1.1': '2016-08-12T23:24:44.095Z',
     '7.1.2': '2016-08-12T23:47:50.678Z' },
  author: 'Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)',
  repository: 
   { type: 'git',
     url: 'git+https://github.com/sindresorhus/gulp-rev.git' },
  readmeFilename: 'readme.md',
  homepage: 'https://github.com/sindresorhus/gulp-rev#readme',
  keywords: 
   [ 'gulpplugin',
     'rev',
     'revving',
     'revision',
     'hash',
     'optimize',
     'version',
     'versioning',
     'cache',
     'expire',
     'static',
     'asset',
     'assets' ],
  bugs: { url: 'https://github.com/sindresorhus/gulp-rev/issues' },
  license: 'MIT',
  users: 
   { '326060588': true,
     brutto: true,
     wayneseymour: true,
     jden: true,
     'shonny.ua': true,
     zckrs: true,
     nakosung: true,
     peterchizzle: true,
     stonecypher: true,
     bluehazetech: true,
     dfl: true,
     levisl176: true,
     zhangyaochun: true,
     ziink: true,
     richarddavenport: true,
     pmcalabrese: true,
     grantls: true,
     imanu: true,
     kulakowka: true,
     evan2x: true,
     joaocunha: true,
     atriix: true,
     samhou1988: true,
     simplyianm: true,
     asmolyakov: true,
     ginof: true,
     mpcjazz: true,
     laravelfanatic: true,
     mrtwister: true,
     chriszs: true,
     thoroc: true,
     jruif: true,
     wangwen1220: true,
     thatk: true,
     xiechao06: true,
     maskedcoder: true,
     ifeature: true,
     makowski: true,
     klimnikita: true,
     stiyes: true,
     pensierinmusica: true,
     elussich: true,
     nunn: true,
     thierrymarianne: true,
     artjacob: true,
     nazjunaid: true,
     neefrankie: true,
     wangnan0610: true,
     lijiehe: true,
     '456wyc': true,
     sparrow: true,
     kjarnet: true,
     nickleefly: true,
     fadihania: true,
     niuca: true,
     huangdawei: true,
     bian17888: true,
     wolfhoundjesse: true,
     akash_shah: true,
     maxwang: true,
     xgheaven: true,
     seleckis: true,
     donggw2030521: true,
     dennykuo: true,
     rajivmehtajs: true,
     dezeloper: true,
     petewarrior: true,
     ijunlin: true,
     arvinxiang: true,
     xiaochao: true,
     whudongyang: true,
     rubiadias: true,
     caesor: true,
     slowfish: true,
     haihepeng: true,
     piotrlewandowski: true,
     youngfoo: true,
     quality520: true,
     zoxon: true,
     bushuai: true,
     acoyang: true,
     kevinfszu: true,
     affiction: true,
     tdreitz: true,
     evanj0hnson: true,
     jsdnxx: true,
     mobeicaoyuan: true,
     xingtao: true,
     tedyhy: true,
     tmurngon: true,
     flynntsc: true,
     kele527: true,
     mutian: true,
     iori20091101: true,
     itonyyo: true,
     wenwu92: true,
     fdeneux: true,
     'stone-jin': true,
     kodekracker: true,
     icodes: true,
     raojs: true },
  version: '7.1.2',
  engines: { node: '>=0.10.0' },
  scripts: { test: 'xo && mocha' },
  files: [ 'index.js' ],
  dependencies: 
   { 'gulp-util': '^3.0.0',
     'modify-filename': '^1.1.0',
     'object-assign': '^4.0.1',
     'rev-hash': '^1.0.0',
     'rev-path': '^1.0.0',
     'sort-keys': '^1.0.0',
     through2: '^2.0.0',
     'vinyl-file': '^1.1.0' },
  devDependencies: { mocha: '*', xo: '*' },
  xo: { envs: [ 'node', 'mocha' ] },
  gitHead: 'e895123b92f4a39fcf6a3f37dbdd78bc6f93c0c5',
  dist: 
   { shasum: '5e17cc229f6b45c74256f88ad3f2d3e9a3305829',
     tarball: 'https://registry.npmjs.org/gulp-rev/-/gulp-rev-7.1.2.tgz' },
  directories: {} }

npm-v gulp rev
是一个有点无效的命令。它不提供npm软件包的最新版本号
gulp rev
,而是提供您当前安装的npm版本,即
3.10.9

您正在尝试安装一个不存在的gulp rev版本


要安装最新版本的gulp rev,您只需键入
npm install gulp rev

同样的是,如果我运行npm,找不到版本3.10.8,但几个小时前安装了3.10.8…有了您,npm一切都很好。但是尚未安装包
gulp rev