我有npm和node的最后一个版本。我有这个错误/警告:
$ npm --version
2.4.1
$ node --version
v0.10.36
$ npm install
> my_project@0.0.0 preinstall /Users/alex/Documents/projects/ruby/my_project
> script/gem_npm install
npm WARN package.json karma-ie-launcher@0.1.5 No README data
npm WARN package.json karma-qunit@0.1.4 No README data
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/node-sass requires mkdirp@'~0.3.5' but will load
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/mkdirp,
npm WARN unmet dependency which is version 0.5.0
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/testem requires js-yaml@'~0.3.5' but will load
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/js-yaml,
npm WARN unmet dependency which is version 3.2.5
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/testem requires glob@'~3.1.21' but will load
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/glob,
npm WARN unmet dependency which is version 3.2.11
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/karma requires glob@'~3.1.21' but will load
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/glob,
npm WARN unmet dependency which is version 3.2.11
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/karma requires lodash@'~1.1' but will load
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/lodash,
npm WARN unmet dependency which is version 2.4.1
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/karma-coffee-preprocessor/node_modules/coffee-script requires mkdirp@'~0.3.5' but will load
npm WARN unmet dependency /Users/alex/Documents/projects/ruby/my_project/node_modules/mkdirp,
npm WARN unmet dependency which is version 0.5.0
我该如何解决?
答案 0 :(得分:1)
删除node_modules文件夹
rm -rf node_modules/
再次运行npm install
。
答案 1 :(得分:0)
这个已知问题,npm的依赖关系解析有点破,请看这里:https://github.com/isaacs/npm/issues/1341#issuecomment-20634338
最简单的解决方案是手动安装依赖项,或构建package.json,以便在依赖模型之前列出任何也是其他模块依赖项的顶级模块。
例如:从您的日志中提取的npm install mkdirp@'~0.3.5'
。