AriaMinaei/pretty-error

Error, pretty-error@^0.1.18

fundon opened this issue · 6 comments

module.js:333
    throw err;
    ^
Error: Cannot find module 'CSSSelect'
    at Function.Module._resolveFilename (module.js:331:15)
    at Function.Module._load (module.js:273:25)
    at Module.require (module.js:357:17)
    at require (module.js:373:17)
    at Object.<anonymous> (.../pretty-error/node_modules/renderkid/scripts/js/lib/renderKid/styles/rule/Selector.js:3:13)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:349:32)
    at Function.Module._load (module.js:305:12)
    at Module.require (module.js:357:17)
make: *** [web] Error 1

This is strange, since the module should read "CSSselect" instead of "CSSSelect." It appears pretty-error somehow is using an old version of renderkid.

Could you please post the contents of package.json from your local installation of pretty-error and renderkid? (renderkid is a dependency of pretty-error)

My project's package.json

  "dependencies": {
    "koa": "^0.5.5",
    "koa-rt": "0.0.2",
    "koa-redis": "^0.1.0",
    "koa-sess": "^0.3.0",
    "koa-bodyparser": "^0.1.0",
    "koa-methodoverride": "^0.2.0",
    "koa-cure": "0.0.3",
    "koa-favicon": "^1.0.1",
    "koa-flash": "0.0.2",
    "koa-locals": "^0.2.0",
    "koa-logger": "^1.2.0",
    "koa-rewrite": "^1.1.0",
    "koa-router": "^3.1.1",
    "koa-static-cache": "^1.0.7",
    "koa-swig": "^0.3.0",
    "koa-locale": "^0.1.1",
    "koa-i18n": "^0.1.2",
    "debug": "^0.7.4",
    "delegates": "0.0.3",
    "lazy.js": "^0.3.2",
    "microtime": "^0.5.1",
    "mime": "^1.2.11",
    "nodemailer": "^0.6.1",
    "pbkdf2": "0.0.4",
    "pg": "^2.11.1",
    "sequelize": "^1.7.3",
    "slug": "^0.4.2",
    "validator": "^3.10.0",
    "supertest": "^0.9.2",
    "eslint": "^0.4.5"
  },
  "devDependencies": {
    "istanbul": "^0.2.6",
    "jshint": "^2.4.4",
    "should": "^3.1.3",
    "mocha": "^1.18.0",
    "supertest": "^0.9.2",
    "uglify-js": "^2.4.13",
    "request": "^2.34.0",
    "eslint": "^0.4.5",
    "pretty-error": "^0.1.18"
  },
  "engineStrict": true,
  "engines": {
    "node": ">= 0.11.12"
  }

pretty-error's package.json
node_modules/pretty-error

{
  "name": "pretty-error",
  "version": "0.1.18",
  "description": "See nodejs errors with less clutter",
  "main": "scripts/js/lib/PrettyError.js",
  "dependencies": {
    "utila": "~0.3",
    "renderkid": "^0.2.0-beta3"
  },
  "devDependencies": {
    "coffee-script": "~1.6.3",
    "little-popo": "~0.1.4"
  },
  "scripts": {
    "test": "node ./node_modules/coffee-script/bin/cake test",
    "prepublish": "node ./node_modules/coffee-script/bin/cake build"
  },
  "author": {
    "name": "Aria Minaei"
  },
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/AriaMinaei/pretty-error.git"
  },
  "bugs": {
    "url": "https://github.com/AriaMinaei/pretty-error/issues"
  },
  "keywords": [
    "pretty",
    "error",
    "exception",
    "debug",
    "error-handling",
    "readable",
    "colorful",
    "prettify",
    "format",
    "human"
  ],
  "readme": "...",
  "readmeFilename": "README.md",
  "homepage": "https://github.com/AriaMinaei/pretty-error",
  "_id": "pretty-error@0.1.18",
  "dist": {
    "shasum": "4dd7c9913372b39feb1a597bb057039c78d90f3d"
  },
  "_from": "pretty-error@^0.1.17",
  "_resolved": "http://r.cnpmjs.org/pretty-error/download/pretty-error-0.1.18.tgz"
}

renderkid's package.json
node_modules/pretty-error/node_modules/renderkid

{
  "name": "renderkid",
  "version": "0.2.0-beta3",
  "description": "(work in progress)",
  "main": "scripts/js/lib/RenderKid.js",
  "dependencies": {
    "CSSselect": "~0.3.11",
    "htmlparser2": "~3.3.0",
    "joiful-experiments": "~1.2.2",
    "utila": "~0.3",
    "dom-converter": "~0.1"
  },
  "devDependencies": {
    "coffee-script": "~1.6.3",
    "little-popo": "0.1.4"
  },
  "scripts": {
    "test": "node ./node_modules/coffee-script/bin/cake test",
    "prepublish": "node ./node_modules/coffee-script/bin/cake build"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/AriaMinaei/RenderKid.git"
  },
  "bugs": {
    "url": "https://github.com/AriaMinaei/RenderKid/issues"
  },
  "author": {
    "name": "Aria Minaei"
  },
  "license": "MIT",
  "readme": "RenderKid\n=====\n\nStylish console.log for node",
  "readmeFilename": "README.md",
  "homepage": "https://github.com/AriaMinaei/RenderKid",
  "_id": "renderkid@0.2.0-beta3",
  "_from": "renderkid@0.2.0-beta3"
}

My case

  require('pretty-error').start(function() {
    app.listen(config.port);
    console.log('127.0.0.1:' + config.port);
  });

There is a problem with your version of pretty-error's package.json:

{
  "name": "pretty-error",
  "version": "0.1.18",
  "description": "See nodejs errors with less clutter",
  "main": "scripts/js/lib/PrettyError.js",
  "dependencies": {
    "utila": "~0.3",
    "renderkid": "^0.2.0-beta3"

On npm, pretty-error@0.1.18 has renderkid@0.2.0-beta.10 as its dependency. Yours says renderkid@0.2.0-beta3, which is old.

You might have fetched a wrong version of pretty-error. Could you please make sure you're downloading the exact same content that is hosted on npm?

Exactly strange, I removed the pretty-error and reinstalled it. It's pretty good.
Thanks!

I have the same issue.
It's strange behavior of npm. My PR #8 fixes this.