重新设置了node_global和node_cache目录后,总是显示command not found
找了几篇博文后,终于解决了这个问题
 
步骤如下:
1、新建node_global和node_cache目录(我把这两个目录放在node.js安装目录下,方便管理)
2、修改node.js安装目录>node_modules目录>npm目录>npmrc文件,修改里面的内容,文件完整内容改为
prefix=D:\nodejs\node_global
cache=D:\nodejs\node_cache
前2个改为你步骤一新建的两个目录的具体路径,这样顺路把淘宝镜像给设好了,不想设淘宝镜像的可把最后一句去掉
3、因为改变了默认的模块安装路径,所以需要修改环境变量以让命令行识别命令。
用户变量:新建名为path的变量(变量名不区分大小写,已存在就不用新建),值为D:\nodejs\node_global,这个值是你在步骤一种新建的目录的路径
系统变量:新建一个名为NODE_PATH的变量,值为D:\nodejs\node_global\node_modules,这个值是步骤一中新建的node_global下的node_modules文件夹的路径,安装的全局模块就在此目录,(这个目录是安装任意一个模块时就会自动创建,所以配置环境变量前要随便先安装一个模块,比如express、webpack等)
 
这样问题就解决了,记住用户变量和系统变量都要配置,不然还是会出现那个问题。

bash:express:command not found的更多相关文章

  1. bash: express: command not found及vue连接数据库调接口

    今天在使用express -e . 的命令时,cmd给我报了一段不识别的错误: bash: express: command not found ,在网上查了一下,有人指出是express4的版本将命 ...

  2. scp报错 -bash: scp: command not found

    环境:RHEL6.5 使用scp命令报错: [root@oradb23 media]# scp /etc/hosts oradb24:/etc/ -bash: scp: command not fou ...

  3. source /etc/profile报错-bash: id:command is not found

    由于误操作导致 source /etc/profile 报错 -bash: id:command is not found 此时,linux下很多命令到不能能用,包括vi ls 等... 可以使用 e ...

  4. -bash: .bash_profile: command not found

    今天有一同事安装了ORACLE后,在切换账号时遇到错误提示"-bash: .bash_profile: command not found".如下所示 [root@GLETestL ...

  5. Linux下提示 bash: xxx command not found

    今天在虚拟机上安装了CentOS5.5,发现运行一些很正常的诸如:init,shutdown,fdisk 等命令时,悍然提示: bash: xxx command not found. 那么,首先就要 ...

  6. [原创]-bash: iostat: command not found解决办法

    [root@testhost ~]# iostat-bash: iostat: command not found IOSTAT 命令不可用,首先确认sysstat包是否安装,sysstat包中包括i ...

  7. # mysql -u root -p -bash: mysql: command not found

    [root@jboss ~]# mysql -u root -p-bash: mysql: command not found 需要安装mysql # yum install mysql之后就行 了

  8. bash:fdisk:command not found

    bash:fdisk:command not found [lansir@Red-Hat ~]$ fdisk -l-bash: fdisk: command not found 原因是fdisk不在P ...

  9. Centos提示-bash: make: command not found的解决办法

    一般出现这个-bash: make: command not found提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装make.vim等常用命令,直接yum安装下即可: yum - ...

随机推荐

  1. plt 数据可视化

    1.plt.plot(x,y,color) 折线坐标图 import matplotlib.pyplot as plt h = np.linspace(1, 10, 10) v = np.linspa ...

  2. HBase中此类异常解决记录org.apache.hadoop.ipc.RemoteException(java.io.IOException):

    ERROR: Can't get master address from ZooKeeper; znode data == null   一定注意这只是问题的第一层表象,真的问题是: File /hb ...

  3. Derek解读Bytom源码-持久化存储LevelDB

    作者:Derek 简介 Github地址:https://github.com/Bytom/bytom Gitee地址:https://gitee.com/BytomBlockchain/bytom ...

  4. 安装VisualSVN Server 报"Service 'VisualSVN Server' failed to start. Please check VisualSVN Server log in Event Viewer for more details"错误.原因是启动"VisualSVN Server"失败

    安装VisualSVN Server 报"Service 'VisualSVN Server' failed to start. Please check VisualSVN Server ...

  5. EntityFramework Code-First 简易教程(八)-------一对一

    配置一对一(One-to-One)关系: 两个实体中,如果一个实体的一个实例与另一个实体相关,则我们就叫做一对一关系 查看如下代码: public class Student { public Stu ...

  6. Python基础知识:if语句

    1.模拟网站确保用户名是否重复的方式,无视大小写,用到函数lower() #检查用户名是否重复 current_users=['admin','alex','lebran','kaobi','Jame ...

  7. 【PAT】B1032 挖掘机技术哪家强(20 分)

    #include<cstdio> const int maxx= 100010; int school[maxx]={0}; int main() { int n,schid,schsco ...

  8. Go学习笔记01-环境搭建

    最近想学学Go语言,就在笔记本上配置了Go的环境. 本人的运行环境为:Windows 10 1709. 1.下载安装包 到官网下载安装包,官网网址为:Go安装包下载地址 现在Go的最新版本为1.9.2 ...

  9. Vue框架的两种使用方式

    1.单页面应用:使用Vue CLI工具生成脚手架,这是最常见的使用方式,简单用模板生成一个HelloWorld Demo,可以学习Vue的SPA项目结构 2.传统多页面应用:通过script引入Vue ...

  10. 在VUE应用中配置ESLint(代码检查)

    eslint配置方式 注释配置:使用js注释来直接嵌入ESLint配置信息到一个文件里 配置文件:使用一个js文件,JSON或者YAML文件来给整个目录和它的子目录指定配置信息.这些配置可以写在一个文 ...