question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected token <

See original GitHub issue

Hiya,

Was just trying to install avoriaz and give it a test, but it throws an error on the latest release:

Node 4.8.2 npm 5

0 info it worked if it ends with ok
1 verbose cli [ '/Users/reinierkaper/.nvm/versions/node/v4.8.2/bin/node',
1 verbose cli   '/Users/reinierkaper/.nvm/versions/node/v4.8.2/bin/npm',
1 verbose cli   'install',
1 verbose cli   '--save-dev',
1 verbose cli   'avoriaz' ]
2 info using npm@5.0.0
3 info using node@v4.8.2
4 silly install loadCurrentTree
5 silly install readLocalPackageData
6 http fetch GET 200 https://registry.npmjs.org/avoriaz 20ms (from cache)
7 silly pacote tag manifest for avoriaz@latest fetched in 51ms
8 silly install loadIdealTree
9 silly install cloneCurrentTreeToIdealTree
10 silly install loadShrinkwrap
11 verbose stack SyntaxError: Unexpected token <
11 verbose stack     at Object.parse (native)
11 verbose stack     at module.exports (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/lib/utils/parse-json.js:3:15)
11 verbose stack     at /Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/lib/install/read-shrinkwrap.js:31:20
11 verbose stack     at tryCatcher (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
11 verbose stack     at Holder$3._callFunction (eval at <anonymous> (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:1:0), <anonymous>:14:44)
11 verbose stack     at Holder$3.checkFulfillment (eval at <anonymous> (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:1:0), <anonymous>:29:30)
11 verbose stack     at Promise.eval (eval at <anonymous> (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:1:0), <anonymous>:6:20)
11 verbose stack     at Promise._settlePromise (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
11 verbose stack     at Promise._settlePromise0 (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
11 verbose stack     at Promise._settlePromises (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
11 verbose stack     at Promise._fulfill (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
11 verbose stack     at Promise._settlePromise (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:582:21)
11 verbose stack     at Promise._settlePromise0 (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
11 verbose stack     at Promise._settlePromises (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
11 verbose stack     at Promise._fulfill (/Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
11 verbose stack     at /Users/reinierkaper/.nvm/versions/node/v4.8.2/lib/node_modules/npm/node_modules/bluebird/js/release/nodeback.js:42:21
12 verbose cwd /Users/reinierkaper/projects/docker/canvaspop
13 verbose Darwin 16.6.0
14 verbose argv "/Users/reinierkaper/.nvm/versions/node/v4.8.2/bin/node" "/Users/reinierkaper/.nvm/versions/node/v4.8.2/bin/npm" "install" "--save-dev" "avoriaz"
15 verbose node v4.8.2
16 verbose npm  v5.0.0
17 error Unexpected token <
18 verbose exit [ 1, true ]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
eddyerburghcommented, Jul 27, 2017

Did you try deleting the npm cache? It might solve your issue.

On OSX/ linux -

rm -rf ~/.npm

I know that npm 5 has a few bugs related to their new cacheing implementation.

0reactions
TheDutchCodercommented, Jul 27, 2017

Yeah that makes sense. I’ll close this issue for now and see if I can get it to work in some other way. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

syntax error: unexpected token - javascript - Stack Overflow
The error SyntaxError: Unexpected token < likely means the API endpoint didn't return JSON in its document body, such as due to a...
Read more >
Have a JavaScript Unexpected Token Error? Check Your Syntax
The JavaScript's parser expects tokens and symbols in a particular order, with relevant values or variables in between. Often, an Unexpected ...
Read more >
JavaScript Error Handling: Unexpected Token - GeeksforGeeks
Not follow them throws an error.An unexpected token occurs if JavaScript code has a missing or extra character { like, ) + –...
Read more >
SyntaxError: Unexpected token in JavaScript | bobbyhadz
The "Uncaught SyntaxError: Unexpected token" error also occurs if you have a missing or extra bracket, parenthesis or comma.
Read more >
How to fix JavaScript unexpected token error
As you write your JavaScript application, the unexpected token error always occurs because JavaScript expected a specific syntax that's not ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found