[英]Getting error MODULE NOT FOUND in express.js
You need to make sure that Express
is installed.您需要确保已安装
Express
。
Run the following command运行以下命令
npm i express --save
Also check if you have package.json file in your App's root directory.还要检查您的应用程序的根目录中是否有 package.json 文件。 If there is not then run the following command.
如果没有,则运行以下命令。
npm init
npm i express --save
First of all, make you have initialized npm that will end up creating the package.json file:首先,让您初始化 npm 最终将创建 package.json 文件:
npm init
then install the express library然后安装 express 库
npm i express
after that, you are trying to run a file called index.js Your Node CLI cannot find it in the respected directory Make sure to fix your run command as follow之后,您尝试运行一个名为 index.js 的文件您的节点 CLI 在受尊重的目录中找不到它确保按以下方式修复您的运行命令
node .\{FILE_NAME}.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.