npm error enoent:no such file or directory...are-we-there-yet ; package.json文件和node_modules模相互转化

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” 命令;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值