因为使用webpack创建vue项目时,用到了vue-router。在自己安装vue-router遇到错误。
使用以下语句安装时会报错(no such file or directory:)
npm install vue-router --save
--save参数的作用是在我们的包配置文件package.json文件中添加对应的配置。
改成如下代码成功
npm install -g vue-router --save