简体   繁体   English

执行应用程序 Plesk NodeJS 前的准备工作

[英]Preparation work before executing the app Plesk NodeJS

I'm trying to deploy an Api Rest that was build on NodeJS Express and when I try to make the deploy process, I got this error.我正在尝试部署在 NodeJS Express 上构建的 Api Rest,当我尝试进行部署过程时,出现此错误。 I don't know hoy can I solve this:我不知道我能解决这个问题吗:

在此处输入图像描述

在此处输入图像描述

The problem is that you are importing some modules in your app.js with the import function, but you can't do that because you are stating in your config to treat your js files as module, to import external modules inside ES modules you should use the following structure:问题是您正在使用导入 function 在 app.js 中导入一些模块,但您不能这样做,因为您在配置中声明将 js 文件视为模块,要在 ES 模块中导入外部模块,您应该使用以下结构:

"import { something } from /path/to/module" “从 /path/to/module 导入 {something}”

Let me know if it solved your problem!让我知道它是否解决了您的问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM