`
lizhuang
  • 浏览: 903813 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

express command not found解决方法

 
阅读更多
express不能运行



安装Node.js的web框架Express:npm install -g express,键入命令:express –help,出现提示:sh: express: command not found。明明安装了express,但却告知不能命令运行express。如图

Image

解决方案1

在安装express时增加generator参数:

npm install -g express-generator

解决方案2

npm install -g express@3.4.4
安装老版本的express

原因解释

为什么要加上generator呢?

原先的express带cli, 现在把cli拆成了单独的express-generator包. 原先的express运行生成的项目是node app.js, 因为httpserver相关代码都在app.js里, 现在这部分代码移到了项目目录的bin/www下面, app.js只保留实现app的逻辑代码, 你需要去运行那个bin/www。 只是很单纯的细化应用和包依赖的版本变更。

此外,express命令行在AppData\Roaming\npm下面,默认AppData\Roaming\npm在环境变量path里。
分享到:
评论

相关推荐

    Mac express全局安装后 command not found

    Mac express全局安装后 command not found 异常信息: express command not found 我mac电脑上安装了express 和express-generator之后,依然会出现如上 找不到命令的异常信息,真是气死人。 后来,仔细观察,发现...

    详解Angular调试技巧之报错404(not found)

    在Angular的开发过程中,调试是不可或缺的一环,尤其是在遇到404 (Not Found)这类错误时,理解如何解决显得尤为重要。404错误通常意味着浏览器无法找到请求的资源,这在Angular应用中可能是由于HTML、JavaScript文件...

    mail帮助文件.doc

    解决方法是使用标准邮件客户端(如Outlook Express、Foxmail)或通过网页发送邮件。 - **Boxisbusy**:收到“Boxisbusy”的退信通知,表明邮件内容可能触发了敏感词过滤或邮箱正忙。此时,应等待一段时间后再尝试...

    Bochs - The cross platform IA-32 (x86) emulator

    (tested with Mingw gcc 4.5.1 and Microsoft Visual Studio Express 2010) - Added ability to configure CPUID stepping through .bochsrc. The default stepping value is 3. - Added ability to disable ...

    OutlookAttachView v2.73

    aware that OutlookAttachView doesn't work with Outlook Express. Versions History ================ * Version 2.73 o OutlookAttachView now also scans the root folder of the .pst file. * Version ...

    acpi控制笔记本风扇转速

    Integrated a fix for a problem with PCI Express HID detection in the PCI Config Space setup procedure. (BZ 7145) Moved all FADT-related functions to a new file, tbfadt.c. Eliminated the ...

    联想旭日420AXP系统芯片组驱动

    several command line flags for various installation options. Due to the different distribution formats available for the Intel(R) Chipset Software Installation Utility, the command line flag syntax ...

    eac3to V3.17

    * fixed: error code not set for "source file format could not be detected" * fixed: audio resampling from/to 24.975 didn't work properly * fixed: WAV files beginning with lots of zeroes were sometimes...

    带注释的Bootstrap.java

    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org....

    详解Nodejs 部署到阿里云全过程

    这样,即使以sudo用户运行Node.js命令也不会出现“command not found”错误。 现在开始安装MongoDB。创建必要的目录,如数据和日志存储位置。下载MongoDB的Linux二进制包,解压并重命名文件夹。创建 `/var/mongodb/...

    xplite_trial

    XPlite gives you full command over the Windows File Protection (WFP) feature. Windows File Protection is a powerful Windows feature that prevents system files from being overwritten by poorly ...

    Java邮件开发Fundamentals of the JavaMail API

    doesn't sound like much, but it is your basic MIME-type support found in many browsers and mail tools today. After downloading the framework, unbundle the jaf1_0_1.zip file, and add the activation....

    WTL 9.1 5270 ReadMe 中文 汉化 中英文对照版 01d

    from frame and popup windows, to MDI, standard and common controls, common dialogs, property sheets and pages, GDI objects, UI updating, scrollable windows, splitter windows, command bars, etc....

    ICS delphixe10源码版

    This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software. Permission is granted...

    WTL 9.1 5270 Beta 中文 汉化 中英文对照版

    from frame and popup windows, to MDI, standard and common controls, common dialogs, property sheets and pages, GDI objects, UI updating, scrollable windows, splitter windows, command bars, etc....

Global site tag (gtag.js) - Google Analytics