2017-05-04 52 views
0

感謝您的訪問和回覆。 背景說明: 最近我在做亞馬遜網站「AVS」,現在進入步驟5.8-5.9。 AVS的API鏈接地址: https://github.com/alexa/alexa-avs-sample-app/wiki/Windows#6---run-the-sample-appAVS-「npm start」 - 產品錯誤

當我運行「故宮開始」,暗示該產品的錯誤,還有一些其他的錯誤,當然,不排除我的定位錯了錯了,請幫忙看看錯誤的建議。下面是一個錯誤消息:

*LvandeMacBook-Pro:companionService lvan$ npm start 
> [email protected] start /Users/lvan/Documents/amazon/alexa-avs-sample-app/samples/companionService 
> node ./bin/www 
This node service needs to be running to store token information memory and vend them for the AVS app. 
/Users/lvan/Documents/amazon/alexa-avs-sample-app/samples/companionService/config.js:27 
     「amzn1.application.6f4d5046ead64b188c95a8d3a0567741」: [「123456」], 
     ^
SyntaxError: Invalid or unexpected token 
    at createScript (vm.js:56:10) 
    at Object.runInThisContext (vm.js:97:10) 
    at Module._compile (module.js:542:28) 
    at Object.Module._extensions..js (module.js:579:10) 
    at Module.load (module.js:487:32) 
    at tryModuleLoad (module.js:446:12) 
    at Function.Module._load (module.js:438:3) 
    at Module.require (module.js:497:17) 
    at require (internal/module.js:20:19) 
    at Object.<anonymous> (/Users/lvan/Documents/amazon/alexa-avs-sample-app/samples/companionService/authentication.js:4:14) 
npm ERR! Darwin 16.5.0 
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" 
npm ERR! node v6.10.2 
npm ERR! npm v3.10.10 
npm ERR! code ELIFECYCLE 
npm ERR! [email protected] start: `node ./bin/www` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node ./bin/www'. 
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 alexa-voice-service-sample-companion-service package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node ./bin/www 
npm ERR! You can get information on how to open an issue for this project with: 
npm ERR!  npm bugs alexa-voice-service-sample-companion-service 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls alexa-voice-service-sample-companion-service 
npm ERR! There is likely additional logging output above. 
npm ERR! Please include the following file with any support request: 
npm ERR!  /Users/lvan/Documents/amazon/alexa-avs-sample-app/samples/companionService/npm-debug.log 
LvandeMacBook-Pro:companionService lvan$* 

此外,添加兩種可能的解釋性文件 「NPM列表」 和 「config.js」 如下:

LvandeMacBook-Pro:companionService lvan$ npm list 
[email protected] /Users/lvan/Documents/amazon/alexa-avs-sample-app/samples/companionService 
├─┬ [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ └─┬ [email protected] 
│ ├── [email protected] 
│ └─┬ [email protected] 
│  └── [email protected] 
├─┬ [email protected] 
│ └── [email protected] 
├─┬ [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├─┬ [email protected] 
│ │ ├── [email protected] 
│ │ └── [email protected] 
│ ├── [email protected] 
│ ├── [email protected] 
│ └── [email protected] 
├─┬ [email protected] 
│ ├── [email protected] 
│ └─┬ [email protected] 
│ └── [email protected] 
└── [email protected] 

config.js

/** 
* @module 
* This module defines the settings that need to be configured for a new 
* environment. 
* The clientId and clientSecret are provided when you create 
* a new security profile in Login with Amazon. 
* 
* You will also need to specify 
* the redirect url under allowed settings as the return url that LWA 
* will call back to with the authorization code. The authresponse endpoint 
* is setup in app.js, and should not be changed. 
* 
* lwaRedirectHost and lwaApiHost are setup for login with Amazon, and you should 
* not need to modify those elements. 
*/ 
var config = { 
    clientId: 'amzn1.application-oa2-client.d2be48eb59494####5fb004d8701', 
    clientSecret: 'f830ccf171b61d15bbd5f#######efe2695eaec26e897a59ab6', 
    redirectUrl: 'https://localhost:3000/authresponse', 
    lwaRedirectHost: 'amazon.com', 
    lwaApiHost: 'api.amazon.com', 
    validateCertChain: true, 
    sslKey: '/Users/lvan/Documents/amazon/alexa-avs-sample-app/samples/javaclient/certs/server/node.key', 
    sslCert: '/Users/lvan/Documents/amazon/alexa-avs-sample-app/samples/javaclient/certs/server/node.crt', 
    sslCaCert: '/Users/lvan/Documents/amazon/alexa-avs-sample-app/samples/javaclient/certs/ca/ca.crt', 
    products: { 
     「amzn1.application.6f4d5046#####95a8d3a0567741」: [「123456」], 
    }, 
}; 


module.exports = config; 

再次感謝您的光臨和回覆

回答

0

此問題已解決,符號問題