mixu/markdown-styles

Error: Cannot find module 'yargs'

chaosink opened this issue · 11 comments

I used npm first but failed. It said "In most cases you or one of your dependencies are requesting a package version that doesn't exist. It was specified as a dependency of 'miniq'." I tried to install miniq and failed either.
So I turn to building it by myself, however it said as the title shows... : (
Help, please!

No compatible version found: microee@'>=0.0.6 <0.1.0'
Valid install targets:
["0.0.5","0.0.4","0.0.3","0.0.2","0.0.1"]

mixu commented

I need a lot more info to debug this, sounds like an old version of node or npm or some kind of partial install issue. What node version? What npm version? What operating system? Can you post the npm-debug.log? Did you try rm -rfing the node_modules folder in case you ran into a partial install due to an error? What does npm ls say in the markdown-styles folder?

Here's an example trace from me installing the latest version just now:

[~] uname -a
Linux localhost 3.10.18 #1 SMP Mon Feb 23 00:29:31 PST 2015 x86_64 x86_64 x86_64 GNU/Linux
[~] cat /etc/issue
Ubuntu 12.04.5 LTS \n \l
[~] npm -v  
2.1.12
[~] node -v
v0.10.34
[~] npm install -g markdown-styles@latest
/home/m/.nvm/v0.10.34/bin/generate-md -> /home/m/.nvm/v0.10.34/lib/node_modules/markdown-styles/bin/generate-md
markdown-styles@2.0.3 /home/m/.nvm/v0.10.34/lib/node_modules/markdown-styles
├── xtend@4.0.0
├── mkdirp@0.3.5
├── resolve@0.6.3
├── yargs@1.1.3 (minimist@0.0.10)
├── pipe-iterators@1.1.0 (merge-stream@0.1.6, through2@0.6.3, clone@0.1.18, miniq@1.0.0, readable-stream@1.0.33)
├── wildglob@0.0.1 (mm-brace-expand@0.0.1, microee@0.0.5, miniq@0.1.2, glob-parse@0.0.1, through2@0.5.1, minimatch@0.4.0)
├── handlebars@2.0.0 (optimist@0.3.7, uglify-js@2.3.6)
└── markdown-stream-utils@1.0.2 (marked@0.3.3, through2@0.6.3, highlight.js@8.4.0, js-yaml@3.2.7)
[~] cd  /home/m/.nvm/v0.10.34/lib/node_modules/markdown-styles/
[markdown-styles @(no branch)] npm ls 
markdown-styles@2.0.3 /home/m/.nvm/v0.10.34/lib/node_modules/markdown-styles
├─┬ handlebars@2.0.0
│ ├─┬ optimist@0.3.7
│ │ └── wordwrap@0.0.2
│ └─┬ uglify-js@2.3.6
│   ├── async@0.2.10
│   └─┬ source-map@0.1.43
│     └── amdefine@0.1.0
├─┬ markdown-stream-utils@1.0.2
│ ├── highlight.js@8.4.0
│ ├─┬ js-yaml@3.2.7
│ │ ├─┬ argparse@1.0.2
│ │ │ ├── lodash@3.6.0
│ │ │ └── sprintf-js@1.0.2
│ │ └── esprima@2.0.0
│ ├── marked@0.3.3
│ └─┬ through2@0.6.3
│   └─┬ readable-stream@1.0.33
│     ├── core-util-is@1.0.1
│     ├── inherits@2.0.1
│     ├── isarray@0.0.1
│     └── string_decoder@0.10.31
├── mkdirp@0.3.5
├─┬ pipe-iterators@1.1.0
│ ├── clone@0.1.18
│ ├── merge-stream@0.1.6
│ ├─┬ miniq@1.0.0
│ │ ├── microee@0.0.6
│ │ └── ondone@1.0.0
│ ├─┬ readable-stream@1.0.33
│ │ ├── core-util-is@1.0.1
│ │ ├── inherits@2.0.1
│ │ ├── isarray@0.0.1
│ │ └── string_decoder@0.10.31
│ └── through2@0.6.3
├── resolve@0.6.3
├─┬ wildglob@0.0.1
│ ├── glob-parse@0.0.1
│ ├── microee@0.0.5
│ ├─┬ minimatch@0.4.0
│ │ ├── lru-cache@2.5.0
│ │ └── sigmund@1.0.0
│ ├── miniq@0.1.2
│ ├── mm-brace-expand@0.0.1
│ └─┬ through2@0.5.1
│   ├─┬ readable-stream@1.0.33
│   │ ├── core-util-is@1.0.1
│   │ ├── inherits@2.0.1
│   │ ├── isarray@0.0.1
│   │ └── string_decoder@0.10.31
│   └── xtend@3.0.0
├── xtend@4.0.0
└─┬ yargs@1.1.3
  └── minimist@0.0.10

➜ ~ uname -a
Linux lin-N56VZ 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
➜ ~ cat /etc/issue
Linux Mint 17 Qiana \n \l
➜ ~ npm -v
2.7.3
➜ ~ node -v
v0.10.33
➜ ~ sudo npm install -g markdown-styles@latest
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "markdown-styles@latest"
npm ERR! node v0.10.33
npm ERR! npm v2.7.3
npm ERR! code ETARGET

npm ERR! notarget No compatible version found: microee@'>=0.0.6 <0.1.0'
npm ERR! notarget Valid install targets:
npm ERR! notarget ["0.0.5","0.0.4","0.0.3","0.0.2","0.0.1"]
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! notarget
npm ERR! notarget It was specified as a dependency of 'miniq'
npm ERR! notarget

npm ERR! Please include the following file with any support request:
npm ERR! /home/lin/npm-debug.log
➜ ~

mixu commented

Thanks - I tried upgrading to npm 2.7.3 but I still can't reproduce the issue. I also tried installing microee@0.0.6 directly and that also worked. Can you try doing npm cache clean + npm install --loglevel verbose microee@0.0.6?

[~] mkdir /tmp/test-install-microee
[~] cd /tmp/test-install-microee 
[test-install-microee] npm -v
2.7.3
[test-install-microee] node -v
v0.10.34
[test-install-microee] npm cache clean
[test-install-microee] ls -lah /home/m/.npm
ls: cannot access /home/m/.npm: No such file or directory
[test-install-microee] npm install --loglevel verbose microee@0.0.6
npm info it worked if it ends with ok
npm verb cli [ 'node',
npm verb cli   '/home/m/.nvm/v0.10.34/bin/npm',
npm verb cli   'install',
npm verb cli   '--loglevel',
npm verb cli   'verbose',
npm verb cli   'microee@0.0.6' ]
npm info using npm@2.7.3
npm info using node@v0.10.34
npm verb cache add spec microee@0.0.6
npm verb addNamed microee@0.0.6
npm verb addNameVersion registry:https://registry.npmjs.org/microee not in flight; fetching
npm verb request uri https://registry.npmjs.org/microee
npm verb request no auth needed
npm info attempt registry request try #1 at 09:09:54
npm verb request id 53433b55712c5c99
npm http request GET https://registry.npmjs.org/microee
npm http 200 https://registry.npmjs.org/microee
npm verb get saving microee to /home/m/.npm/registry.npmjs.org/microee/.cache.json
npm verb getCacheStat cache creation not in flight; initializing
npm verb addRemoteTarball https://registry.npmjs.org/microee/-/microee-0.0.6.tgz not in flight; adding
npm verb addRemoteTarball [ 'https://registry.npmjs.org/microee/-/microee-0.0.6.tgz',
npm verb addRemoteTarball   'a12bdb0103681e8b126a9b071eba4c467c78fffe' ]
npm info retry fetch attempt 1 at 09:09:54
npm info attempt registry request try #1 at 09:09:54
npm http fetch GET https://registry.npmjs.org/microee/-/microee-0.0.6.tgz
npm http fetch 200 https://registry.npmjs.org/microee/-/microee-0.0.6.tgz
npm verb addTmpTarball /tmp/npm-23214-9af61af9/registry.npmjs.org/microee/-/microee-0.0.6.tgz not in flight; adding
npm verb addTmpTarball already have metadata; skipping unpack for microee@0.0.6
npm verb afterAdd /home/m/.npm/microee/0.0.6/package/package.json not in flight; writing
npm verb afterAdd /home/m/.npm/microee/0.0.6/package/package.json written
npm info install microee@0.0.6 into /tmp/test-install-microee
npm info installOne microee@0.0.6
npm verb installOne of microee to /tmp/test-install-microee not in flight; installing
npm verb lock using /home/m/.npm/_locks/microee-b9e6e9e922c69d8b.lock for /tmp/test-install-microee/node_modules/microee
npm verb unbuild node_modules/microee
npm verb gentlyRm don't care about contents; nuking /tmp/test-install-microee/node_modules/microee
npm verb tar unpack /home/m/.npm/microee/0.0.6/package.tgz
npm verb tar unpacking to /tmp/test-install-microee/node_modules/microee
npm verb gentlyRm don't care about contents; nuking /tmp/test-install-microee/node_modules/microee
npm info preinstall microee@0.0.6
npm verb about to build /tmp/test-install-microee/node_modules/microee
npm info build /tmp/test-install-microee/node_modules/microee
npm verb linkStuff [ false, false, false, '/tmp/test-install-microee/node_modules' ]
npm info linkStuff microee@0.0.6
npm verb linkBins microee@0.0.6
npm verb linkMans microee@0.0.6
npm verb rebuildBundles microee@0.0.6
npm info install microee@0.0.6
npm info postinstall microee@0.0.6
npm verb unlock done using /home/m/.npm/_locks/microee-b9e6e9e922c69d8b.lock for /tmp/test-install-microee/node_modules/microee
microee@0.0.6 node_modules/microee
npm verb exit [ 0, true ]
npm info ok 
[test-install-microee] node -e "console.log(Object.keys(require('microee').prototype));"
[ 'on',
  'removeListener',
  'removeAllListeners',
  'listeners',
  'emit',
  'when',
  'once' ]
mixu commented

OK I noticed that microee had latest tagged at 0.0.5 for some reason, maybe a npm glitch back when I published it, I tagged 0.0.6 as latest. Maybe that was causing the issue, even though I was unable to repro? Make sure you do (sudo) npm cache clean just in case.

[test-install-microee] npm info microee

{ name: 'microee',
  description: 'A tiny EventEmitter-like client and server side library',
  'dist-tags': { latest: '0.0.5' },
  versions: 
   [ '0.0.1',
     '0.0.2',
     '0.0.3',
     '0.0.5',
     '0.0.6' ],
  maintainers: 'mixu <mixu@mixu.net>',
  time: 
   { modified: '2014-02-27T22:34:22.616Z',
     created: '2012-10-05T03:24:24.113Z',
     '0.0.1': '2012-10-05T03:24:25.459Z',
     '0.0.2': '2012-10-05T22:04:25.299Z',
     '0.0.3': '2014-01-06T21:11:37.563Z',
     '0.0.4': '2014-01-28T21:49:22.789Z',
     '0.0.5': '2014-01-29T01:55:09.286Z',
     '0.0.6': '2014-02-27T22:15:25.103Z' },
  author: 'Mikito Takada <mixu@mixu.net> (http://mixu.net/)',
  repository: 
   { type: 'git',
     url: 'git://github.com/mixu/microee' },
  readmeFilename: 'readme.md',
  homepage: 'https://github.com/mixu/microee',
  keywords: 
   [ 'event',
     'events',
     'eventemitter',
     'emitter' ],
  bugs: { url: 'https://github.com/mixu/microee/issues' },
  license: 'BSD',
  version: '0.0.5',
  main: 'index.js',
  scripts: { test: 'mocha --ui exports --reporter spec --bail ./test/microee.test.js' },
  devDependencies: 
   { mocha: '*',
     'uglify-js': '~2.4.12' },
  dist: 
   { shasum: '972cca0be26033cd43472235325d5cb9610a8d57',
     tarball: 'http://registry.npmjs.org/microee/-/microee-0.0.5.tgz' },
  directories: {} }
[microee @master] npm dist-tag ls microee
latest: 0.0.5
[microee @master] npm dist-tag add microee@0.0.6 latest
+latest: microee@0.0.6
[microee @master] npm dist-tag ls microee              
latest: 0.0.6
[microee @master] npm info microee                     

{ name: 'microee',
  description: 'A tiny EventEmitter-like client and server side library',
  'dist-tags': { latest: '0.0.6' },
  versions: 
   [ '0.0.1',
     '0.0.2',
     '0.0.3',
     '0.0.5',
     '0.0.6' ],
  maintainers: 'mixu <mixu@mixu.net>',
  time: 
   { modified: '2014-02-27T22:34:22.616Z',
     created: '2012-10-05T03:24:24.113Z',
     '0.0.1': '2012-10-05T03:24:25.459Z',
     '0.0.2': '2012-10-05T22:04:25.299Z',
     '0.0.3': '2014-01-06T21:11:37.563Z',
     '0.0.4': '2014-01-28T21:49:22.789Z',
     '0.0.5': '2014-01-29T01:55:09.286Z',
     '0.0.6': '2014-02-27T22:15:25.103Z' },
  author: 'Mikito Takada <mixu@mixu.net> (http://mixu.net/)',
  repository: 
   { type: 'git',
     url: 'git://github.com/mixu/microee' },
  readmeFilename: 'readme.md',
  homepage: 'https://github.com/mixu/microee',
  keywords: 
   [ 'event',
     'events',
     'eventemitter',
     'emitter' ],
  bugs: { url: 'https://github.com/mixu/microee/issues' },
  license: 'BSD',
  version: '0.0.6',
  main: 'index.js',
  scripts: { test: './node_modules/.bin/mocha --ui exports --reporter spec --bail ./test/microee.test.js' },
  devDependencies: 
   { mocha: '*',
     'uglify-js': '~2.4.12' },
  dist: 
   { shasum: 'a12bdb0103681e8b126a9b071eba4c467c78fffe',
     tarball: 'http://registry.npmjs.org/microee/-/microee-0.0.6.tgz' },
  directories: {} }

➜ ~ sudo npm cache clean
➜ ~ sudo npm install -g markdown-styles
After executing the above command, the slash just keeps rotating for a long time and it seems that it won't end.

mixu commented

So could you run it with --loglevel verbose or allow it to finish properly?

mixu commented

ah, this explains it:

http://status.npmjs.org/

DDoS attack on our CDN Subscribe
Monitoring - Along with GitHub and other services today, we are feeling the effects of an unprecedentedly large and sophisticated DDoS attack. We are not the target of the attack, but we share infrastructure with the target and are being hit by side-effects of the attack.

Our CDN provider are hard at work mitigating the attack, and we will update here as things develop.
Mar 27, 22:03 UTC

mixu commented

In the meanwhile, maybe a npmjs mirror would work, e.g. http://blog.modulus.io/npm-mirrors

➜ ~ sudo npm -g install microee
microee@0.0.6 /usr/local/lib/node_modules/microee
➜ ~ sudo npm -g install markdown-styles
/usr/local/bin/generate-md -> /usr/local/lib/node_modules/markdown-styles/bin/generate-md
markdown-styles@2.0.3 /usr/local/lib/node_modules/markdown-styles
├── xtend@4.0.0
├── mkdirp@0.3.5
├── resolve@0.6.3
├── yargs@1.1.3 (minimist@0.0.10)
├── pipe-iterators@1.1.0 (merge-stream@0.1.6, through2@0.6.3, clone@0.1.18, miniq@1.0.0, readable-stream@1.0.33)
├── wildglob@0.0.1 (mm-brace-expand@0.0.1, microee@0.0.5, glob-parse@0.0.1, miniq@0.1.2, through2@0.5.1, minimatch@0.4.0)
├── markdown-stream-utils@1.0.2 (marked@0.3.3, highlight.js@8.4.0, through2@0.6.3, js-yaml@3.2.7)
└── handlebars@2.0.0 (optimist@0.3.7, uglify-js@2.3.6)

I used an unofficial registry before which I forgot. After turning to the main npm registry, It works.
Thank you so much ! : )

mixu commented

👍