vue-cli项目一段时间没有变动,几个星期后继续编辑安装 npm install vue-skeleton-webpack-plugin 插件时报错 npm error enoent:no such file or directory...are-we-there-yet 错误
产生错误的原因:This is still an active issue on Modulus. I've found through some hard lessons that you definitely need to make sure you're making conscious decisions for component versions. All the way from node and npm versions, to things in package.json. If you specify latest version, you will end up with errors when you least want them.
分析:当确定项目版本迭代时候,在package.json文件中要确定所依赖的node、npm组件版本,不然会导致这样的错误。
"engines": {"node": ">= 6.0.0", //最新"npm": "6.11.2" //指定版本},
解决思路:重装依赖或指定项目所使用的依赖版本
方法1:重装npm ,命令行窗口使用 npm install -g npm (亲测有效)
方法2:获取报错时的npm版本并在package.json文件中指定所依赖的node、npm组件版本
详细参考网址:https://stackoverflow.com/questions/31025048/npm-doesnt-work-get-always-this-error-error-cannot-find-module-are-we-the
PS
1、node_modules模块生成package.json文件使用 “npm init” 命令;
2、将package.json文件自动批量下载安装依赖的node_modules模块使用 “npm install” 命令;