繁体   English   中英

node.js和express -bash:/ usr / bin / express:没有这样的文件或目录

[英]node.js and express -bash: /usr/bin/express: No such file or directory

我从node.js映像(w ubuntu 14.04)启动了一个数字海洋小滴,检查它,我得到:

$ node -v
  v4.3.0

然后,我尝试安装最新版本的express.js:

    $ sudo npm install -g express
    express@4.13.4 /usr/lib/node_modules/express
    ├── escape-html@1.0.3
    ├── array-flatten@1.1.1
    ├── cookie-signature@1.0.6
    ├── utils-merge@1.0.0
    ├── content-type@1.0.1
    ├── merge-descriptors@1.0.1
    ├── vary@1.0.1
    ├── methods@1.1.2
    ├── fresh@0.3.0
    ├── etag@1.7.0
    ├── parseurl@1.3.1
    ├── path-to-regexp@0.1.7
    ├── cookie@0.1.5
    ├── content-disposition@0.5.1
    ├── range-parser@1.0.3
    ├── serve-static@1.10.2
    ├── depd@1.1.0
    ├── qs@4.0.0
    ├── on-finished@2.3.0 (ee-first@1.1.1)
    ├── finalhandler@0.4.1 (unpipe@1.0.0)
    ├── debug@2.2.0 (ms@0.7.1)
    ├── proxy-addr@1.0.10 (forwarded@0.1.0, ipaddr.js@1.0.5)
    ├── send@0.13.1 (destroy@1.0.4, statuses@1.2.1, ms@0.7.1, mime@1.3.4, http-errors@1.3.1)
    ├── type-is@1.6.11 (media-typer@0.3.0, mime-types@2.1.10)
    └── accepts@1.2.13 (negotiator@0.5.3, mime-types@2.1.10)

但是当我检查快速版本时,出现错误:

  $ express -v
 -bash: /usr/bin/express: No such file or directory

有什么问题吗? 感谢您的反馈

更新-

我卸载并重新安装了node.js:

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodes
$ node -v
v4.3.1

但同样的问题

sudo npm install -g express express@4.13.4 / usr / lib / node_modules / express ... $ express -v -bash:/ usr / bin / express:没有这样的文件或目录

检查PATH变量中是否存在/usr/lib/node_modules/express

echo $PATH将显示当前PATH

此外,也许您不是安装express-generator吗?

暂无
暂无

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

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