ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

javascript – npm install出错

2019-06-24 02:24:34  阅读:177  来源: 互联网

标签:ubuntu javascript node-js gruntjs


即时通讯尝试在我的机器上设置节点….在root下安装了npm和grunt-cli -g,当我在我的代码目录中运行npm install时出现以下错误

sudo npm install
npm WARN prefer global grunt-cli@0.1.13 should be installed with -g
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify requires resolve@'~0.7.1' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-browserify/node_modules/resolve,
npm WARN unmet dependency which is version 1.0.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify requires through2@'^1.0.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-browserify/node_modules/watchify/node_modules/through2,
npm WARN unmet dependency which is version 0.5.1
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-config requires mout@'~0.9.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-json requires graceful-fs@'~2.0.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.5
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-registry-client requires async@'~0.2.8' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/async,
npm WARN unmet dependency which is version 0.1.22
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-registry-client requires graceful-fs@'~2.0.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.5
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-registry-client requires lru-cache@'~2.3.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/lru-cache,
npm WARN unmet dependency which is version 2.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-registry-client requires request@'~2.27.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/request,
npm WARN unmet dependency which is version 2.42.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-registry-client requires mkdirp@'~0.3.5' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/mkdirp,
npm WARN unmet dependency which is version 0.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/decompress-zip requires nopt@'~2.2.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/nopt,
npm WARN unmet dependency which is version 3.0.1
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/inquirer requires lodash@'~2.4.1' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/lodash,
npm WARN unmet dependency which is version 0.10.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/insight requires async@'^0.9.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/async,
npm WARN unmet dependency which is version 0.1.22
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/insight requires chalk@'^0.5.1' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/chalk,
npm WARN unmet dependency which is version 0.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/insight requires inquirer@'^0.6.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/inquirer,
npm WARN unmet dependency which is version 0.7.1
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json requires graceful-fs@'~2.0.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.5
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client requires graceful-fs@'~2.0.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.5
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client requires lru-cache@'~2.3.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/lru-cache,
npm WARN unmet dependency which is version 2.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client requires request@'~2.27.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request,
npm WARN unmet dependency which is version 2.42.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client requires mkdirp@'~0.3.5' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/mkdirp,
npm WARN unmet dependency which is version 0.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/decompress-zip requires nopt@'~2.2.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/nopt,
npm WARN unmet dependency which is version 3.0.1
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/insight requires chalk@'^0.5.1' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk,
npm WARN unmet dependency which is version 0.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/insight requires inquirer@'^0.6.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/inquirer,
npm WARN unmet dependency which is version 0.7.1
bhavan@bhavan-Inspiron-N5010:~/oyo/website$sudo npm install
npm WARN prefer global grunt-cli@0.1.13 should be installed with -g
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify requires resolve@'~0.7.1' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-browserify/node_modules/resolve,
npm WARN unmet dependency which is version 1.0.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-browserify/node_modules/watchify/node_modules/browserify requires through2@'^1.0.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-browserify/node_modules/watchify/node_modules/through2,
npm WARN unmet dependency which is version 0.5.1
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-config requires mout@'~0.9.0' but will load
npm WARN unmet dependency undefined,
npm WARN unmet dependency which is version undefined
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-json requires graceful-fs@'~2.0.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.5
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-registry-client requires async@'~0.2.8' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/async,
npm WARN unmet dependency which is version 0.1.22
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-registry-client requires graceful-fs@'~2.0.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.5
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-registry-client requires lru-cache@'~2.3.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/lru-cache,
npm WARN unmet dependency which is version 2.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-registry-client requires request@'~2.27.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/request,
npm WARN unmet dependency which is version 2.42.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/bower-registry-client requires mkdirp@'~0.3.5' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/mkdirp,
npm WARN unmet dependency which is version 0.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/decompress-zip requires nopt@'~2.2.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/nopt,
npm WARN unmet dependency which is version 3.0.1
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/inquirer requires lodash@'~2.4.1' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/lodash,
npm WARN unmet dependency which is version 0.10.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/insight requires async@'^0.9.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/async,
npm WARN unmet dependency which is version 0.1.22
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/insight requires chalk@'^0.5.1' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/chalk,
npm WARN unmet dependency which is version 0.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/insight requires inquirer@'^0.6.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bower-task/node_modules/bower/node_modules/inquirer,
npm WARN unmet dependency which is version 0.7.1
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-json requires graceful-fs@'~2.0.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.5
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client requires graceful-fs@'~2.0.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.5
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client requires lru-cache@'~2.3.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/lru-cache,
npm WARN unmet dependency which is version 2.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client requires request@'~2.27.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/request,
npm WARN unmet dependency which is version 2.42.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/bower-registry-client requires mkdirp@'~0.3.5' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/mkdirp,
npm WARN unmet dependency which is version 0.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/decompress-zip requires nopt@'~2.2.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/nopt,
npm WARN unmet dependency which is version 3.0.1
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/insight requires chalk@'^0.5.1' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/chalk,
npm WARN unmet dependency which is version 0.5.0
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/insight requires inquirer@'^0.6.0' but will load
npm WARN unmet dependency /home/bhavan/oyo/website/node_modules/grunt-bowercopy/node_modules/bower/node_modules/inquirer,
npm WARN unmet dependency which is version 0.7.1
er code here

解决方法:

在我的系统上,这是由于未正确安装的软件包(安装在中途中止).

在我的例子中,所有npm WARN未满足的依赖/ path / node_modules / package / messages都引用了同一个包,所以我从node_modules目录中删除了该包并重新安装它.这解决了我遇到的所有问题. (即使在尝试安装不依赖于有问题的软件包的软件包时,npm也会发出此错误,这仍然解决了这个问题)

在您的情况下,列出了几个包,因此:

>删除Node模块目录

rm -r node-modules

>重新安装包

npm install

>如果仍未安装您尝试安装的软件包,请重新安装.

npm install --save package

对于遇到此问题的其他人,如果您尝试安装的软件包是全局软件包,则可能必须删除全局node_modules目录. npm ls -g –depth 0将告诉您全局node_modules目录的位置,并为您提供已安装软件包的列表.请注意这些因为您需要手动重新安装它们.

标签:ubuntu,javascript,node-js,gruntjs
来源: https://codeday.me/bug/20190624/1275826.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有