node.js - npm install express-generator not installing express -
i'm following mean stack tutorial requires me have express installed:
i run this:
npm install -g express-generator
and results:
username@username-inspiron-3521:~$ npm install -g express-generator /home/username/npm/bin/express -> /home/username/npm/lib/node_modules/express-generator/bin/express express-generator@4.13.1 /home/username/npm/lib/node_modules/express-generator ├── sorted-object@1.0.0 ├── mkdirp@0.5.1 (minimist@0.0.8) └── commander@2.7.1 (graceful-readlink@1.0.1)
but when do
express --ejs flapper-news
the program 'express' not installed. can install typing: sudo apt-get install node-express
what doing wrong?
thanks time.
edit
when npm install
username@username-inspiron-3521:~/documents/mean/flapper_news$ npm install npm err! install couldn't read dependencies npm err! linux 3.16.0-51-generic npm err! argv "/home/username/local/bin/node" "/home/username/local/bin/npm" "install" npm err! node v4.2.1 npm err! npm v2.14.7 npm err! path /home/username/documents/mean/flapper_news/package.json npm err! code enopackagejson npm err! errno -2 npm err! syscall open npm err! package.json enoent: no such file or directory, open '/home/username/documents/mean/flapper_news/package.json' npm err! package.json not problem npm itself. npm err! package.json npm can't find package.json file in current directory. npm err! please include following file support request: npm err! /home/username/documents/mean/flapper_news/npm-debug.log
edit2
after running npm install -g express
, typing express -v
this:
bash: /usr/bin/express: no such file or directory
edit3
this .bashrc
file:
### added heroku toolbelt export path="/usr/local/heroku/bin:$path" export path="$path:$home/.rvm/bin" # add rvm path scripting export path=$home/local/bin:$path export node_path=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript:/home/username/npm/lib/node_modules export path=/home/username/android/sdk/platform-tools:$path export path=/home/username/android/sdk/tools:$path
looking @ line output npm install -g express generator
/home/username/npm/bin/express -> /home/username/npm/lib/node_modules/express-generator/bin/express
your npm installing global modules within home directory , it's placing binary links in /home/username/npm/bin
directory, you'll need add path. add .bashrc
:
export path=$home/npm/bin:$path
Comments
Post a Comment