2016-04-12 16 views
1

こんにちは、npmのインストールで問題があります: すべてのフォルダを削除しても、削除して再インストールしても動作しません。これをnpm installで修正するには:(npm ERR!installは依存関係を読み込めませんでした)?

> [email protected]:~$ npm install 
> npm ERR! install Couldn't read dependencies 
> npm ERR! Linux 4.2.0-35-generic 
> npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" 
> npm ERR! node v4.4.2 
> npm ERR! npm v2.15.0 
> npm ERR! file /home/lucas/package.json 
> npm ERR! code EJSONPARSE 

> npm ERR! Failed to parse json 
> npm ERR! Unexpected token ':' at 1:17 
> npm ERR! "dependencies": { 
> npm ERR!    ^
> npm ERR! File: /home/lucas/package.json 
> npm ERR! Failed to parse package.json data. 
> npm ERR! package.json must be actual JSON, not just JavaScript. 
> npm ERR! 
> npm ERR! This is not a bug in npm. 
> npm ERR! Tell the package author to fix their package.json file. JSON.parse 

> npm ERR! Please include the following file with any support request: 
> npm ERR!  /home/lucas/npm-debug.log 
+1

あなたのpackage.jsonファイルが有効なJSONではないようです。完全なファイルを提供できますか? – Komo

答えて

0

NPMのは、最大何を伝える:

> npm ERR! File: /home/lucas/package.json 
> npm ERR! Failed to parse package.json data. 
> npm ERR! package.json must be actual JSON, not just JavaScript. 
> npm ERR! 
> npm ERR! This is not a bug in npm. 
> npm ERR! Tell the package author to fix their package.json file. JSON.parse 

あなたのJSONファイルが有効であることを確認してください。あなたはそれを確認することができますon JSONLint。依存セクションがどのように見えるかは次のとおりです。周囲のオブジェクトの括弧に注目してください。

NPMのマニュアルの「依存関係」セクションについて
{ "dependencies" : 
    { "foo" : "1.0.0 - 2.9999.9999" 
    , "bar" : ">=1.0.2 <2.1.2" 
    , "baz" : ">1.0.2 <=2.3.4" 
    , "boo" : "2.0.1" 
    , "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0" 
    , "asd" : "http://asdf.com/asdf.tar.gz" 
    , "til" : "~1.2" 
    , "elf" : "~1.2.3" 
    , "two" : "2.x" 
    , "thr" : "3.3.x" 
    , "lat" : "latest" 
    , "dyl" : "file:../dyl" 
    } 
} 

See this writeup、およびpackage.jsonのあなたのセクションには、「依存関係」の前に来て、特に任意の文字、似ていることを確認してください。

関連する問題