Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ncu -m bower -- Fails with unexpected token error. #239

Closed
atom0s opened this issue May 25, 2016 · 6 comments
Closed

ncu -m bower -- Fails with unexpected token error. #239

atom0s opened this issue May 25, 2016 · 6 comments

Comments

@atom0s
Copy link

atom0s commented May 25, 2016

Trying to use either of the following commands yields the error below:

ncu -m bower
ncu --packageManager bower
Unhandled rejection SyntaxError: Unexpected token 
    at Object.parse (native)
    at C:\Users\atom0s\AppData\Roaming\npm\node_modules\bower\lib\node_modules\bower-json\lib\json.js:42:29
    at C:\Users\atom0s\AppData\Roaming\npm\node_modules\bower\lib\node_modules\graceful-fs\graceful-fs.js:78:16
    at C:\Users\atom0s\AppData\Roaming\npm\node_modules\npm-check-updates\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:404:3)

Screenshot of the error:
http://i.imgur.com/d3u4qY1.png

Works fine with normal npm, but with bower I cannot get it to work on the latest version of ncu. (v2.6.5 as of this issue report.)

@raineorshine
Copy link
Owner

Hi! Thanks for reporting. Can you provide the contents of your bower.json.
It looks like saying it is invalid json. You may want to verify that it is
syntactically correct.
On Wed, May 25, 2016 at 12:45 PM atom0s [email protected] wrote:

Trying to use either of the following commands yields the error below:

ncu -m bower
ncu --packageManager bower

Unhandled rejection SyntaxError: Unexpected token 
at Object.parse (native)
at C:\Users\atom0s\AppData\Roaming\npm\node_modules\bower\lib\node_modules\bower-json\lib\json.js:42:29
at C:\Users\atom0s\AppData\Roaming\npm\node_modules\bower\lib\node_modules\graceful-fs\graceful-fs.js:78:16
at C:\Users\atom0s\AppData\Roaming\npm\node_modules\npm-check-updates\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose as oncomplete

Screenshot of the error:
http://i.imgur.com/d3u4qY1.png

Works fine with normal npm, but with bower I cannot get it to work on the
latest version of ncu. (v2.6.5 as of this issue report.)


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#239

@atom0s
Copy link
Author

atom0s commented May 27, 2016

The bower.json file for the erroring project is:

{
  "name": "ProjectNameRemoved",
  "private": true,
  "dependencies": {
    "angular": "~1.4.9",
    "angular-ellipsis": "~0.1.6",
    "angular-moment": "~0.10.3",
    "angular-summernote": "~0.8.1",
    "animate.css": "~3.5.1",
    "bootstrap": "~3.3.6",
    "font-awesome": "~4.5.0",
    "jquery": "~2.2.0",
    "jquery-geocomplete": "~1.6.5",
    "ngInfiniteScroll": "~1.2.1",
    "twitter-bootstrap-wizard": "https://github.com/VinceG/twitter-bootstrap-wizard.git#~1.0.0",
    "jquery-validation": "jquery.validate#~1.13.0",
    "angular-ui-bootstrap-datetimepicker": "~0.14.4",
    "ng-currency": "~0.9.2",
    "angular-ui": "~0.4.0",
    "summernote": "~0.8.1",
    "modernizr": "~2.8.1",
    "moment": "~2.11.1",
    "smoothscroll-for-websites": "^1.4.2",
    "jquery.tagcloud.js": "https://github.com/addywaddy/jquery.tagcloud.js.git",
    "kbwood_countdown": "2.0.1",
    "jquery-deparam": "^0.5.1",
    "Slidebars": "^0.10.3"
  },
  "resolutions": {
    "angular": "~1.4.9",
    "moment": "~2.11.1"
  },
  "overrides": {
    "jquery-deparam": {
      "main": [
        "jquery-deparam.js"
      ]
    },
    "bootstrap": {
      "main": [
        "less/bootstrap.less",
        "fonts/*",
        "dist/js/bootstrap.js"
      ]
    },
    "font-awesome": {
      "main": [
        "fonts/*",
        "less/font-awesome.less"
      ]
    },
    "angular-ui": {
      "main": [
        "build/angular-ui.js"
      ]
    },
    "jquery.tagcloud.js": {
      "main": [
        "jquery.tagcloud.js"
      ]
    },
    "kbwood_countdown": {
      "main": [
        "jquery.plugin.js",
        "jquery.countdown.js"
      ]
    },
    "Slidebars": {
      "main": [
        "dist/slidebars.css",
        "dist/slidebars.js"
      ]
    }
  },
  "devDependencies": {
    "chai": "~3.5.0",
    "mocha": "~2.4.5"
  }
}

@raineorshine
Copy link
Owner

I've narrowed it down to kbwood_countdown...

@raineorshine
Copy link
Owner

$ bower info kbwood_countdown
bower not-cached    https://github.com/kbwood/countdown.git#*
bower resolve       https://github.com/kbwood/countdown.git#*
bower checkout      kbwood_countdown#2.0.2
bower EMALFORMED    Failed to read /var/folders/6q/pxzpp6mx459fkp_cbm6ns09m0000gn/T/raine/bower/e92da5830629c95ba39931e2f02d38ba-87371-iUyJGS/bower.json

Additional error details:
Unexpected token

@raineorshine
Copy link
Owner

Bingo: kbwood/countdown#67

@raineorshine
Copy link
Owner

Solution: Revert to kbwood_countdown v2.0.1 until a patch comes out for v2.0.2. You can use ncu --reject kbwood_countdown to exclude the package from ncu in the mean time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants