感谢您的光临和回复。背景描述:最近我在做亚马逊网站“AVS”,现在进行步骤5.8-5.9。AVS的API链接地址: https://github.com/alexa/alexa-avs-sample-app/wiki/Windows#6---run-the-sample-app
当我运行“npm start”时,提示产品错误,还有一些其他的错误,当然不排除我的定位错误错误,请帮忙看看错误提示。以下是一条错误消息:
*LvandeMacBook-Pro:companionService lvan$ npm start
> alexa-voice-service-sample-companion-service@1.0.0 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! alexa-voice-service-sample-companion-service@1.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the alexa-voice-service-sample-companion-service@1.0.0 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 list”和“config.js”,如下:
LvandeMacBook-Pro:companionService lvan$ npm list
alexa-voice-service-sample-companion-service@1.0.0 /Users/lvan/Documents/amazon/alexa-avs-sample-app/samples/companionService
├─┬ body-parser@1.12.4
│ ├── bytes@1.0.0
│ ├── content-type@1.0.2
│ ├── depd@1.0.1
│ ├── iconv-lite@0.4.8
│ ├─┬ on-finished@2.2.1
│ │ └── ee-first@1.1.0
│ ├── qs@2.4.2
│ ├─┬ raw-body@2.0.2
│ │ └── bytes@2.1.0
│ └─┬ type-is@1.6.15
│ ├── media-typer@0.3.0
│ └─┬ mime-types@2.1.15
│ └── mime-db@1.27.0
├─┬ debug@2.2.0
│ └── ms@0.7.1
├─┬ express@4.12.4
│ ├─┬ accepts@1.2.13
│ │ └── negotiator@0.5.3
│ ├── content-disposition@0.5.0
│ ├── cookie@0.1.2
│ ├── cookie-signature@1.0.6
│ ├── escape-html@1.0.1
│ ├─┬ etag@1.6.0
│ │ └── crc@3.2.1
│ ├── finalhandler@0.3.6
│ ├── fresh@0.2.4
│ ├── merge-descriptors@1.0.0
│ ├── methods@1.1.2
│ ├── parseurl@1.3.1
│ ├── path-to-regexp@0.1.3
│ ├─┬ proxy-addr@1.0.10
│ │ ├── forwarded@0.1.0
│ │ └── ipaddr.js@1.0.5
│ ├── range-parser@1.0.3
│ ├─┬ send@0.12.3
│ │ ├── destroy@1.0.3
│ │ └── mime@1.3.4
│ ├── serve-static@1.9.3
│ ├── utils-merge@1.0.0
│ └── vary@1.0.1
├─┬ node-storage@0.0.7
│ ├── async@0.9.2
│ └─┬ mkdirp@0.5.1
│ └── minimist@0.0.8
└── node-uuid@1.4.1
配置.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;
再次感谢您的光临和回复