express コマンドのcommand not found を解決するのに手間取った話。
【事象】
node.jsの expreass generatorを使って見ようと思い、
ターミナルからexpressコマンドを叩いてみたが、command not found
express --version
zsh: command not found: express
先日、express-generatorのインストールだけをしていたのだが、
上手くいっていなかったのかと思い、再インストールをしてから試してみてもダメだった。
【原因&解決方法】
パスが通ってなかった。
node.jsをインストールしたときに、他の方の記事を見て、思考停止で色々な事をコピペしていたのがいけていなかった。
(自分がnode.jsインストールするときに何か余計な事をしたのかも。。。)
↓のコマンドでnpmのpathを確認する。
npm bin -g
上記で表示されたpathを.bash_profile
に設定する。
(↓のXXXXX部分を表示された内容に設定)
export PATH=XXXXX:${PATH}
設定したら、↓のコマンドを叩く。
source ~/.bash_profile
再度、expressコマンドを叩いたら上手くいった。
express --version
4.16.1
Author And Source
この問題について(express コマンドのcommand not found を解決するのに手間取った話。), 我々は、より多くの情報をここで見つけました https://qiita.com/D3wQF956/items/8ae23496104e782167af著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .