关于npm:运行nrm报错Cannot-find-module-npm

问题形容

在命令提示符中应用npm i nrm -g装置nrm后,运行nrm报错,提醒

Cannot find module 'npm'

解决办法

通过排查发现是nrm目录下的npm版本问题,通过批改package.json文件并重新安装nrm目录下的npm解决,具体操作如下

  • 找到nrm的装置目录,比方我的装置目录是D:\Program Files (x86)\Nodist\bin\node_modules\nrm
  • 批改目录下的package.json文件,将依赖中的"npm": "latest"改为"npm": "^6.0.0"
  • 在目录下运行npm i重新安装npm

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理