2011-04-13 69 views
0

這裏有什麼問題?問題是package.json?

/opt/local/lib/node/.npm/embedly/0.3.2/package/package.json:1 
"name": "embedly 
    ^

node.js:134 
     throw e; // process.nextTick error, or 'error' event on first tick 
     ^
13 Apr 02:23:06 - [ERROR] SyntaxError 
SyntaxError: Unexpected token : 

的package.json

{ "name": "embedly" 
, "version": "0.3.2" 
, "description": "Embedly client library for node" 
, "homepage": "https://github.com/embedly/embedly-node" 
, "keywords": [] 
, "author": 
    { "name": "Bob Corsaro" 
    , "email": "[email protected]" 
    , "url": "http://www.google.com/profiles/rcorsaro" 
    } 
, "repository": 
    { "type": "git" 
    , "url": "git://github.com/embedly/embedly-node" 
    } 
, "bugs": { "web": "http://github.com/embedly/embedly-node/issues/" } 
, "directories": 
    { "doc": "./docs" 
    , "lib": "./lib" 
    , "test": "./test" 
    } 
, "dependencies": {"hashish": "", "qs": ""} 
, "devDependencies": {"vows": ">= 0.5.6"} 
, "main": "./lib/embedly.js" 
, "scripts": { "test": "vows" } 
, "bin": 
    { "embedly_oembed": "bin/embedly_oembed.js" 
    , "embedly_objectify": "bin/embedly_objectify.js" 
    , "embedly_preview": "bin/embedly_preview.js" 
    } 
} 
+1

它看起來像缺少雙引號,但它有助於向我們展示package.json文件。 – yojimbo87 2011-04-13 08:55:58

+0

我用json文件更新了帖子。 – fancy 2011-04-13 11:42:53

回答

0

此錯誤是從語句

_package = require('embedly/package.json') 

這是一個錯誤,我會立刻把它固定很快拋出。

+0

?你如何解決這個問題?你不應該要求package.json嗎? – Paul 2012-12-11 05:41:37

+0

修正是要求('./ package.json') – 2014-04-28 18:11:21

1

很多事情可能是錯的居然出現,你肯定會收到以.json格式是否正確?它在我看來你錯過了一個雙引號,但也許我錯了。

+0

好吧,我剛剛檢查過,JSON是正確的,它是一個有效的.json。儘管我不認爲node.js是錯誤的,但實際上可能是您沒有正確解碼包含JSON對象的文件。也許與base64/base32庫有關的問題? – Masiar 2011-04-13 11:56:50