npm 安装错误.errno 4058



当我尝试为我的软件包安装依赖项时,我收到以下错误

npm WARN package@1.0.0 No description
npm WARN package@1.0.0 No repository field.
npm ERR! path C:Usersuser_nameDesktoptypeScript_react_webpack_app_templatenode_modulestypescript
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:Usersuser_nameDesktoptypeScript_react_webpack_app_templatenode_modulestypescript' -> 'C:Usersuser_nameDesktoptypeScript_react_webpack_app_templatenode_modules.typescript.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:Usersuser_nameAppDataRoamingnpm-cache_logs2017-07-07T08_55_48_803Z-debug.log

我的包.json

{
"name": "package",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.25.0",
"babel-loader": "^7.1.1",
"babel-preset-es2017": "^6.24.1",
"babel-preset-react": "^6.24.1",
"ts-loader": "^2.2.2",
"typescript": "^2.4.1",
"webpack": "^3.0.0"
},
"dependencies": {
"react": "^15.6.1",
"react-dom": "^15.6.1"
}
}

如果我将软件包安装为 npm 安装打字稿,一切正常。 这个问题有什么解决方案?

删除package-lock.json并再次运行npm

检查节点和 npm 是否正确安装

用于检查类型

npm -v

如果没有号码,请正确安装。

如果有任何数字凸轮,则安装了 npm,然后继续

快速修复:-删除包-锁定.json,然后重试

如果上述不起作用,请执行以下步骤

1( 删除包锁.json

2(打开任务管理器并关闭所有NodeJS进程

3( 运行 npm 初始化或 npm 安装

4(如果不起作用,则重新启动系统

相关内容

最新更新