简体   繁体   English

首次尝试启动解析服务器项目时找不到模块“ http2”

[英]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.

相关问题 React - 错误:尝试运行 npm 启动时找不到模块反应 - React - Error: Cannot find module react when trying to run npm start 尝试运行 node.js 样板项目时找不到模块“Socket.IO-node” - Cannot find module 'Socket.IO-node' when trying to run node.js boilerplate project 无法启动Docker映像-“找不到模块json-server” - Cannot start docker image - “cannot find module json-server” 错误:尝试运行简单的服务器 js 文件时找不到模块“socket.io” - Error: Cannot find module 'socket.io' when trying to run a simple server js file 错误:运行“http”时找不到模块“moduleIntro.js” - Error: Cannot find module “moduleIntro.js” when running “http” 尝试部署到Heroku时出现“找不到模块&#39;异步&#39;”错误 - “Cannot find module 'async'” error when trying to deploy to Heroku 尝试运行电子应用程序时找不到模块应用程序 - Cannot find module app when trying to run electron app 尝试从 JavaScript 文件导入时找不到模块 - Cannot find module when trying import from JavaScript files 实验警告:http2模块是实验API - ExperimentalWarning: The http2 module is an experimental API 构建项目时,无法在服务器上找到子项目 - When building a project, cannot find a sub project on the server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM