[英]Cannot find module 'http2' when trying to start a parse server project for the first time
So I'm starting my first project with parse and while following these direction in the docs 因此,我开始使用解析开始我的第一个项目,同时遵循文档中的这些指示
$ sh <(curl -fsSL https://raw.githubusercontent.com/parse-community/parse-server/master/bootstrap.sh)
$ npm install -g mongodb-runner
$ mongodb-runner start
$ npm start
I get " Cannot find module 'http2' " Has anyone come accross this and how can i get this project to start. 我收到“找不到模块'http2'”有没有人遇到这个问题,我该如何启动这个项目。
node -v => v8.3.0 mongo -v => v4.0.0 节点-v => v8.3.0 mongo -v => v4.0.0
http2 requires at least v8.7.0. http2至少需要v8.7.0。
So if if you don't have any NodeJS version manager yet, you can use https://github.com/tj/n 因此,如果您还没有任何NodeJS版本管理器,则可以使用https://github.com/tj/n
Assume you use n
, run the command 假设您使用
n
,运行命令
n lts
to install the latest LTS (should be higher than 8.7.0 from this point on) 安装最新的LTS(此后应高于8.7.0)
According to the doc, run 根据文档,运行
parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
where APPLICATION_ID and MASTER_KEY can be any arbitrary strings. 其中APPLICATION_ID和MASTER_KEY可以是任意字符串。 If that still fails then run
如果仍然失败,则运行
npm i http2 -g
It'd be helpful to know what version of nodejs you're using. 了解您正在使用哪个版本的nodejs会很有帮助。 (you can get this by running node -v )
(您可以通过运行node -v来获得它)
Try running: npm install http2 尝试运行: npm install http2
Older versions of node.js didn't support http2, it wasn't until very recently that native support for http2 was released. 旧版本的node.js不支持http2,直到最近才发布了对http2的本机支持。
Can you open an issue on the repository please? 您可以在存储库中打开一个问题吗? This should work with your node version.
这应该与您的节点版本一起使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.