html5 - 安装npm时出错:refusing to install grunt as a dependency of itself

查看:321
本文介绍了html5 - 安装npm时出错:refusing to install grunt as a dependency of itself的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

解决方案

我装webpack的时候也出现了这个问题

Refusing to install webpack as a dependency of itself

当时我的package.json是这个样子的

{
  "name": "webpack",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {

  }
}

然后我把name字段改成webpacktest就好了,没错!就好了,太神奇了

{
  "name": "webpacktest",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "gulp": "^3.9.1",
    "webpack": "^1.13.0"
  }
}

这篇关于html5 - 安装npm时出错:refusing to install grunt as a dependency of itself的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆