我目前正在将项目部署到Elastic Beanstalk,但是当我尝试从.ebextensions文件夹中的配置文件运行npm install
时,我遇到了问题。项目的后端在API模式下使用Rails,而前端是使用React在app / client文件夹中提供的。我可以成功部署并打开从Rails API(.. table_1 / all)提供的路由,但React不会呈现任何内容。在本地测试中,我在app / client文件夹中使用'yarn start'。
由于我是初学者,在部署和使用反应方面我会很感激所有帮助我可以解决这个问题。根据下面的日志,我不确定该怎么做。
这是我在.ebextensions
中的配置文件container_commands:
01_npm_install:
cwd: '/var/app/ondeck/client/'
command: 'npm install --timeout 30'
leader_only: 'false'
这是EB CLI中显示的错误:
_ucsb_class_scheduler/Command 01_npm_install] : Activity execution failed, because: npm ERR! Linux 4.9.58-18.55.amzn1.x86_64
npm ERR! argv "/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/bin/node" "/usr/bin/npm" "install" "--timeout" "30"
npm ERR! node v4.6.0
npm ERR! npm v2.15.9
npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/30
npm ERR! 404
npm ERR! 404 '30' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'client'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! /var/app/ondeck/client/npm-debug.log
(ElasticBeanstalk::ExternalInvocationError)
和/var/app/ondeck/client/npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli '--timeout',
1 verbose cli '30' ]
2 info using npm@2.15.9
3 info using node@v4.6.0
4 verbose install initial load of /var/app/ondeck/client/package.json
5 verbose readDependencies loading dependencies from /var/app/ondeck/client/package.json
6 silly cache add args [ '30', null ]
7 verbose cache add spec 30
8 silly cache add parsed spec Result {
8 silly cache add raw: '30',
8 silly cache add scope: null,
8 silly cache add name: '30',
8 silly cache add rawSpec: '',
8 silly cache add spec: 'latest',
8 silly cache add type: 'tag' }
9 silly addNamed 30@latest
10 verbose addNamed "latest" is being treated as a dist-tag for 30
11 info addNameTag [ '30', 'latest' ]
12 silly mapToRegistry name 30
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry data Result {
15 silly mapToRegistry raw: '30',
15 silly mapToRegistry scope: null,
15 silly mapToRegistry name: '30',
15 silly mapToRegistry rawSpec: '',
15 silly mapToRegistry spec: 'latest',
15 silly mapToRegistry type: 'tag' }
16 silly mapToRegistry uri https://registry.npmjs.org/30
17 verbose addNameTag registry:https://registry.npmjs.org/30 not in flight; fetching
18 verbose request uri https://registry.npmjs.org/30
19 verbose request no auth needed
20 info attempt registry request try #1 at 7:33:50 AM
21 verbose request id b42d3e8383778fa0
22 http request GET https://registry.npmjs.org/30
23 http 404 https://registry.npmjs.org/30
24 verbose headers { 'content-type': 'application/json',
24 verbose headers 'cache-control': 'max-age=0',
24 verbose headers 'content-length': '2',
24 verbose headers 'accept-ranges': 'bytes',
24 verbose headers date: 'Thu, 16 Nov 2017 07:33:50 GMT',
24 verbose headers via: '1.1 varnish',
24 verbose headers age: '0',
24 verbose headers connection: 'keep-alive',
24 verbose headers 'x-served-by': 'cache-sea1028-SEA',
24 verbose headers 'x-cache': 'MISS',
24 verbose headers 'x-cache-hits': '0',
24 verbose headers 'x-timer': 'S1510817631.695604,VS0,VE146',
24 verbose headers vary: 'Accept-Encoding' }
25 silly get cb [ 404,
25 silly get { 'content-type': 'application/json',
25 silly get 'cache-control': 'max-age=0',
25 silly get 'content-length': '2',
25 silly get 'accept-ranges': 'bytes',
25 silly get date: 'Thu, 16 Nov 2017 07:33:50 GMT',
25 silly get via: '1.1 varnish',
25 silly get age: '0',
25 silly get connection: 'keep-alive',
25 silly get 'x-served-by': 'cache-sea1028-SEA',
25 silly get 'x-cache': 'MISS',
25 silly get 'x-cache-hits': '0',
25 silly get 'x-timer': 'S1510817631.695604,VS0,VE146',
25 silly get vary: 'Accept-Encoding' } ]
26 verbose stack Error: Registry returned 404 for GET on https://registry.npmjs.org/30
26 verbose stack at makeError (/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12)
26 verbose stack at CachingRegistryClient.<anonymous> (/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:242:14)
26 verbose stack at Request._callback (/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14)
26 verbose stack at Request.self.callback (/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/lib/node_modules/npm/node_modules/request/request.js:200:22)
26 verbose stack at emitTwo (events.js:87:13)
26 verbose stack at Request.emit (events.js:172:7)
26 verbose stack at Request.<anonymous> (/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/lib/node_modules/npm/node_modules/request/request.js:1067:10)
26 verbose stack at emitOne (events.js:82:20)
26 verbose stack at Request.emit (events.js:169:7)
26 verbose stack at IncomingMessage.<anonymous> (/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/lib/node_modules/npm/node_modules/request/request.js:988:12)
27 verbose statusCode 404
28 verbose pkgid 30
29 verbose cwd /var/app/ondeck/client
30 error Linux 4.9.58-18.55.amzn1.x86_64
31 error argv "/opt/elasticbeanstalk/support/node-install/node-v4.6.0-linux-x64/bin/node" "/usr/bin/npm" "install" "--timeout" "30"
32 error node v4.6.0
33 error npm v2.15.9
34 error code E404
35 error 404 Registry returned 404 for GET on https://registry.npmjs.org/30
35 error 404
35 error 404 '30' is not in the npm registry.
35 error 404 You should bug the author to publish it (or use the name yourself!)
35 error 404 It was specified as a dependency of 'client'
35 error 404
35 error 404 Note that you can also install from a
35 error 404 tarball, folder, http url, or git url.
36 verbose exit [ 1, true ]