[英]Can't install any npm packages
我无法安装任何npm软件包。 我输入npm install lodash
,我得到:
npm WARN webdev@1.0.0 No description
npm WARN webdev@1.0.0 No repository field.
npm ERR! path C:\Users\Blake\Desktop\webdev\node_modules\lodash
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Blake\Desktop\webdev\node_modules\lodash' -> 'C:\Users\Blake\Desktop\webdev\node_modules\.lodash.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Blake\AppData\Roaming\npm-cache\_logs\2018-03-15T21_28_45_978Z-debug.log
我的package.json文件如下所示:
{
"name": "webdev",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
我不知道怎么了。 我尝试卸载并重新安装node.js。 我的npm版本是5.6.0。 我尝试安装的每个软件包都会发生这种情况。 请帮忙,我已经尝试修复了好几个小时,但都无济于事。
编辑:我解决了! 程序的绝对噩梦,MalwareBytes Antimalware阻止了它。 我退出了MalwareBytes,现在可以使用了。 该程序不是第一次弄乱我的编码。
删除package.json和package-lock.json文件,使用npm init并重试。
项目工作目录中可能不存在目录node_modules
我将通过运行npm init来确保在工作目录中本地安装了npm。 我还将尝试重新安装npm。
编辑:
删除MalwareBytes反恶意软件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.