简体   繁体   English

创建Node.js Express App时出错。找不到

[英]Error creating Node.js Express App. Cannot find

错误消息

Im trying to create a node.js project in WebStorm Can you tell what am I missing here? 我试图在WebStorm中创建一个node.js项目你能告诉我在这里缺少什么吗?

Got the solution from https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000137190-Create-express-4-15-project-fails- https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000137190-Create-express-4-15-project-fails-获得解决方案

It works! 有用!

  1. npm install -g express-generator npm install -g express-generator

  2. express <project_name> 表达<project_name>

  3. cd <project_name>, npm install cd <project_name>,npm install

  4. in webstorm, File | 在webstorm中,文件| open, choose <project_name> folder 打开,选择<project_name>文件夹

I got the same problem!. 我遇到了同样的问题! The Old WebStorm show this problem to create version 4.15.0 express-app but it works properly for express version 4.14.1 and less. 旧WebStorm显示此问题以创建版本4.15.0 express-app但它适用于快速版本4.14.1及更少。

Have you tried installing required dependencies globally? 您是否尝试过全局安装所需的依赖项? It's usually done like this: 它通常是这样做的:

npm install [dependency_name] -g

In your case it might be that express-generator is either not installed globally or not available in PATH. 在您的情况下,可能是快速生成器未全局安装或在PATH中不可用。

Just choose a different Express version in popup (4.14.1, for example). 只需在弹出窗口中选择不同的Express版本(例如4.14.1)。 While installing through Webstorm. 通过Webstorm安装时。

Just a reminder, when you type: 只需提醒一下,当您键入:

npm install -g express-generator

Use sudo, otherwise it won't work. 使用sudo,否则它将无法正常工作。 Like this: 像这样:

(1) sudo npm install -g express-generator

Then: 然后:

(2) express <Your_project_name>
(3) cd <Your_project_name>
(4) npm install
(5) In WebStorm, File --> Open --> <Your_project_name>

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

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