如何在Node.js中运行复制的项目

时间:2022-04-26 14:43:15

https://github.com/gleitz/mahjong

https://github.com/gleitz/mahjong

I want to run this app on my windows, the directions say: -Install dependencies with npm update -Start the application with node app.js

我想在我的Windows上运行这个应用程序,方向说: - 使用npm update安装依赖项 - 使用节点app.js启动应用程序

it's sound easy so I try myself.

听起来很容易,所以我试试自己。

1.Fist of all , I install node.js on it's official website (https://nodejs.org/en/) I download the 8.9.3 version.

1.首先,我在其官方网站(https://nodejs.org/en/)上安装node.js我下载了8.9.3版本。

after installing node.js 2.open the command line and go to the project path.

安装node.js之后2.打开命令行并转到项目路径。

3.then I input the command npm update. it works,and the node_modules folder is created.But there are some warn message 如何在Node.js中运行复制的项目

3.然后我输入命令npm update。它工作,并创建node_modules文件夹。但有一些警告消息

4.finally input the command node app.js... it's not work with many error message

4.最终输入命令节点app.js ...它不能用于许多错误消息

following is wrong message

以下是错误的消息

如何在Node.js中运行复制的项目 如何在Node.js中运行复制的项目

I wonder know how should I do.Is any thing I didn't installed?

我想知道我该怎么做。我没有安装任何东西吗?

Please help me.I really want to research this mahjong project.

请帮帮我。我真的想研究这个麻将项目。

2 个解决方案

#1


1  

Before running npm update in the directory where you have your project, you should run npm install first to install all the required dependencies needed for the project to run.

在您拥有项目的目录中运行npm update之前,应首先运行npm install以安装项目运行所需的所有必需依赖项。

So I advice to delete the node_modules directory that was created after you ran npm update, after which you can then run npm install. This should solve your issue.

所以我建议删除运行npm update后创建的node_modules目录,之后可以运行npm install。这应该可以解决您的问题。

#2


1  

Update: If you just want to try it online and not run it locally they've hosted a version on the web: http://gleitzman.com/apps/mahjong.

更新:如果您只是想在线试用而不是在本地运行它们,那么它们已在网络上托管了一个版本:http://gleitzman.com/apps/mahjong。


It's not your fault.

这不是你的错。

What you did was correct, but the project documentation needs to be updated. It's not a turn-key solution and you'll need to figure a few things out to get it working.

你所做的是正确的,但项目文档需要更新。这不是一个交钥匙解决方案,你需要弄清楚一些事情才能让它发挥作用。

The error message is says it wants a mongo db instance, but you don't have one running. Try the mongodb home page or google for instructions. If you have docker it is pretty easy: docker run -it -p 27017:27017 mongo.

错误消息是它想要一个mongo数据库实例,但你没有运行。尝试mongodb主页或谷歌的说明。如果你有docker它很简单:docker run -it -p 27017:27017 mongo。

Even after spinning up mongodb I wasn't able to get the app to work locally. You could try contacting the repo maintainer for assistance. They may be happy to help given you've shown interest in their project.

即使在启动mongodb后,我也无法让应用程序在本地运行。您可以尝试联系repo维护者以获取帮助。如果您对他们的项目表现出兴趣,他们可能很乐意提供帮助。

Good Luck!

祝你好运!

#1


1  

Before running npm update in the directory where you have your project, you should run npm install first to install all the required dependencies needed for the project to run.

在您拥有项目的目录中运行npm update之前,应首先运行npm install以安装项目运行所需的所有必需依赖项。

So I advice to delete the node_modules directory that was created after you ran npm update, after which you can then run npm install. This should solve your issue.

所以我建议删除运行npm update后创建的node_modules目录,之后可以运行npm install。这应该可以解决您的问题。

#2


1  

Update: If you just want to try it online and not run it locally they've hosted a version on the web: http://gleitzman.com/apps/mahjong.

更新:如果您只是想在线试用而不是在本地运行它们,那么它们已在网络上托管了一个版本:http://gleitzman.com/apps/mahjong。


It's not your fault.

这不是你的错。

What you did was correct, but the project documentation needs to be updated. It's not a turn-key solution and you'll need to figure a few things out to get it working.

你所做的是正确的,但项目文档需要更新。这不是一个交钥匙解决方案,你需要弄清楚一些事情才能让它发挥作用。

The error message is says it wants a mongo db instance, but you don't have one running. Try the mongodb home page or google for instructions. If you have docker it is pretty easy: docker run -it -p 27017:27017 mongo.

错误消息是它想要一个mongo数据库实例,但你没有运行。尝试mongodb主页或谷歌的说明。如果你有docker它很简单:docker run -it -p 27017:27017 mongo。

Even after spinning up mongodb I wasn't able to get the app to work locally. You could try contacting the repo maintainer for assistance. They may be happy to help given you've shown interest in their project.

即使在启动mongodb后,我也无法让应用程序在本地运行。您可以尝试联系repo维护者以获取帮助。如果您对他们的项目表现出兴趣,他们可能很乐意提供帮助。

Good Luck!

祝你好运!