2016-08-30 11 views
0

私はnodejsプロジェクトをLinuxサーバーに展開しています。私はnodejsを実行しようとすると、次のエラーに直面します。サーバーで 'async'モジュールを見つけることができません

Cannot find module 'async' in server. 

私は理由を見つけることができません。誰も私が何をしなければならないと私に示唆することができます。

package.json

{ 
    "name": "works", 
    "version": "0.0.0", 
    "main": "server.js", 
    "dependencies": { 
    "async": "^1.2.1", 
    "bcrypt-nodejs": "0.0.3", 
    "bcryptjs": "^2.1.0", 
    "body-parser": "^1.13.1", 
    "colors": "^1.1.2", 
    "cors": "^2.7.1", 
    "express": "^4.13.0", 
    "jwt-simple": "^0.3.0", 
    "moment": "^2.10.3", 
    "mongoose": "^4.0.6", 
    "morgan": "^1.6.0", 
    "jsonwebtoken": "^5.7.0", 
    "request": "^2.58.0" 
    } 
} 
npm install

のインストール中。私は、次の取得エラー:それはあなたのnode_modulesになりますよりも、非同期 をインストールhttps://www.npmjs.com/package/async

は、あなたが最初にそれをインストールする必要があり 、 NPM:

npm http GET https://registry.npmjs.org/async 
npm http GET https://registry.npmjs.org/bcrypt-nodejs/0.0.3 
npm http GET https://registry.npmjs.org/bcryptjs 
npm http GET https://registry.npmjs.org/body-parser 
npm http GET https://registry.npmjs.org/colors 
npm http GET https://registry.npmjs.org/cors 
npm http GET https://registry.npmjs.org/express 
npm http GET https://registry.npmjs.org/jwt-simple 
npm http GET https://registry.npmjs.org/moment 
npm http GET https://registry.npmjs.org/mongoose 
npm http GET https://registry.npmjs.org/morgan 
npm http GET https://registry.npmjs.org/jsonwebtoken 
npm http GET https://registry.npmjs.org/request 

npm ERR! Error: failed to fetch from registry: colors 
npm ERR!  at /usr/share/npm/lib/utils/npm-registry- client/get.js:139:12 
npm ERR!  at cb (/usr/share/npm/lib/utils/npm-registry- client/request.js:31:9) 
npm ERR!  at Request._callback (/usr/share/npm/lib/utils/npm- registry-client/request.js:136:18) 
npm ERR!  at Request.callback (/usr/lib/nodejs/request/main.js:119:22) 
npm ERR!  at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58) 
npm ERR!  at Request.emit (events.js:88:20) 
npm ERR!  at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12) 
npm ERR!  at ClientRequest.g (events.js:156:14) 
npm ERR!  at ClientRequest.emit (events.js:67:17) 
npm ERR!  at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:7) 
npm ERR! You may report this log at: 
npm ERR!  <http://bugs.debian.org/npm> 
npm ERR! or use 
npm ERR!  reportbug --attach /home/siva/www/emoheal.com/emoheal/npm- debug.log npm 
npm ERR! 
npm ERR! System Linux 3.5.0-17-generic 
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" 
npm ERR! cwd /home/siva/www/emoheal.com/emoheal 
npm ERR! node -v v0.6.19 
npm ERR! npm -v 1.1.4 
npm ERR! message failed to fetch from registry: colors 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /home/siva/www/emoheal.com/emoheal/npm-debug.log 
npm not ok 

My debug.log error

info it worked if it ends with ok 
verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'install', 'async' ] 
info using [email protected] 
info using [email protected] 
verbose config file /home/siva/.npmrc 
verbose config file /usr/etc/npmrc 
verbose config file /usr/share/npm/npmrc 
verbose caching /home/siva/www/emoheal.com/emoheal/package.json 
verbose loadDefaults [email protected] 
verbose from cache /home/siva/www/emoheal.com/emoheal/package.json 
verbose readDependencies: using package.json deps 
verbose cache add [ '[email protected]^1.2.1', null ] 
silly cache add: name, spec, args [ undefined, '[email protected]^1.2.1', [ '[email protected]^1.2.1', null ] ] 
verbose parsed url { pathname: '[email protected]^1.2.1',verbose parsed url path: '[email protected]^1.2.1',verbose parsed url href: '[email protected]^1.2.1' } 
silly cache add: name, spec, args [ 'async', '^1.2.1', [ 'async', '^1.2.1' ] ] 
verbose parsed url { pathname: '^1.2.1', path: '^1.2.1', href: '^1.2.1' } 
verbose addNamed [ 'async', '^1.2.1' ] 
verbose addNamed [ null, null ] 
info addNameTag [ 'async', '^1.2.1' ] 
verbose raw, before any munging async 
verbose url resolving [ 'https://registry.npmjs.org/', './async' ] 
verbose url resolved https://registry.npmjs.org/async 
http GET https://registry.npmjs.org/async 
ERR! Error: failed to fetch from registry: async 
ERR!  at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12 
ERR!  at cb (/usr/share/npm/lib/utils/npm-registry- client/request.js:31:9) 
ERR!  at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18) 
ERR!  at Request.callback (/usr/lib/nodejs/request/main.js:119:22) 
ERR!  at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58) 
ERR!  at Request.emit (events.js:88:20) 
ERR!  at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12) 
ERR!  at ClientRequest.g (events.js:156:14) 
ERR!  at ClientRequest.emit (events.js:67:17) 
ERR!  at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:7) 
ERR! You may report this log at: 
ERR!  <http://bugs.debian.org/npm> 
ERR! or use 
ERR!  reportbug --attach /home/siva/www/emoheal.com/emoheal/npm- debug.log npm 
ERR! 
ERR! System Linux 3.5.0-17-generic 
ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "async" 
ERR! node -v v0.6.19 
ERR! npm -v 1.1.4 
ERR! message failed to fetch from registry: async 
verbose exit [ 1, true ] 
+0

からすべてのプロジェクトの依存関係をインストールするには、package.jsonにそれを追加しましたか?ここにあなたのpackage.jsonを貼り付けることができますか? "作品"、 "バージョン": "0.0.0"、 "メイン": "server.js"、 "依存関係":{ "非同期": " –

+0

私のpackage.jsonは{ "名前" です^ 1.2.1 "、 " bcrypt-nodejs ":" 0.0.3 "、 " bcryptjs ":"^2.1.0 "、 " body-parser ":"^1.13.1 "、 " colors ": "^ 4.13.0"、 "jwt-simple": "^ 0.3.0"、 "moment": "^ 1.1.2"、 "cors": "^ 2.7.1"、 " "^ 2.10.3"、 "mongoose": "^ 4.0.6"、 "morgan": "^ 1.6.0"、 "jsonwebtoken": "^ 5.7.0"、 "リクエスト" 2.58.0 " } } – venkat

+1

4年前にNode.js v0.6.19がリリースされました!最初に新しいバージョンに更新してみてください。 –

答えて

2

は、あなたはこの1つについて話していると思いますあなたはそれを要求することができます。

+0

を実行してください。それもエラー – venkat

+0

を投げますか?あなたが詳細を提供しなければなりません。 – sagie

+0

エラー:Function._load(module.js:279:25)のFunction._resolveFilename(module.js:337:11)で モジュールを見つけられません。Module.require(module.js:359:17)の ) at require(module.js:375:17) atオブジェクト。 (/home/siva/www/emoheal.com/emoheal/server.js:3:13) at Module._compile(module.js:446:26) at Object..js(module.js:464: 10) at Module.load(module.js:353:32)Function._load(module.js:311:12) at Array.0(module.js:484:10) – venkat

-1

は、フォルダをプロジェクトと実行します:

npm install 

このコマンドはpackage.json

+0

上記の更新された質問をご覧ください。 npm installをインストールします。私はそのエラーがある – venkat

関連する問題