2016-04-15 97 views
0

我是節點js中的新手。我嘗試使用seneca框架運行我的第一個節點微服務。但它顯示以下錯誤無法運行節點js seneca microservice

> npm ERR! Linux 4.2.0-16-generic 
> 
> npm ERR! argv "/usr/local/bin/node" "/usr/bin/npm" "start" 
> 
> npm ERR! node v5.10.1 
> 
> npm ERR! npm v3.8.6 
> 
> npm ERR! code ELIFECYCLE 
> 
> npm ERR! [email protected] start: `node server.js` 
> 
> npm ERR! Exit status 2 
> 
> npm ERR! 
> 
> npm ERR! Failed at the [email protected] start script 'node server.js'. 
> 
> npm ERR! Make sure you have the latest version of node.js and npm 
> installed. 
> 
> npm ERR! If you do, this is most likely a problem with the myproject 
> package, 
> 
> npm ERR! not with npm itself. 
> 
> npm ERR! Tell the author that this fails on your system: 
> 
> npm ERR!  node server.js 
> 
> npm ERR! You can get information on how to open an issue for this 
> project with: 
> 
> npm ERR!  npm bugs myproject 
> 
> npm ERR! Or if that isn't available, you can get their info via: 
> 
> npm ERR!  npm owner ls myproject 
> 
> npm ERR! There is likely additional logging output above. 
> 
> 
> npm ERR! Please include the following file with any support request: 
> 
> npm ERR!  ~/Desktop/micro services/myproject/npm-debug.log 

我使用Seneca.js Yeoman生成器來創建此項目。請任何人幫助我。

我的項目直供類似如下結構

 test-seneca 
     | 
     |-- client 
     | |-- css 
     | |-- js 
     | |-- partials 
     | |-- index.html 
     |-- server 
     | |-- api.js 
     |-- test 
     | |-- functional 
     |-- bower.json 
     |-- package.json 
     |-- server.js 

我的package.json是

{ 

    "name": "myproject", 

    "version": "0.0.1", 

    "scripts": { 

    "postinstall": "./node_modules/.bin/webdriver-manager update --standalone && ./node_modules/.bin/bower install", 

    "test": "./node_modules/.bin/protractor test/functional/protractor.conf.js" 

    }, 

    "dependencies": 
{ 

"async": "^0.9.0", 

    "hapi": "~8.2.0", 

    "hapi-seneca": "^1.0.3", 

    "seneca": "git://github.com/rjrodger/seneca.git", 

    "seneca-account": "^0.1.8", 

    "seneca-auth": "git://github.com/rjrodger/seneca-auth.git", 

    "seneca-card": "^0.1.3", 

    "seneca-project": "^0.1.4", 

    "seneca-user": "~0.2.10" 

    }, 

    "devDependencies": { 

    "protractor": "~1.7.0", 

    "bower": "~1.3.12" 

    } 

} 
+0

是什麼ü使用啓動該服務 – Yerken

+0

NPM啓動運行服務器 – jicks

+0

它啓動一些時間,那麼該命令將顯示錯誤 – jicks

回答

0

失敗的原因是因爲yeoman發電機安裝失敗的依賴只是默默地失敗的原因。

如果你看看package.json的內部,你可以看到seneca-authseneca指向非現有回購的依存關係。請更新這些,並再次運行npm install

編輯

我建議你使用這種yeoman產生的。它已經過時,並可能在您的節點版本上失敗。

+0

內容這是做到這一點的最佳方式。而不是妓女。?我是新的節點js – jicks

+0

謝謝,它現在運行。 – jicks

+0

但仍然有另一個問題API不起作用。 – jicks