npm挂了?最近几天突然npm安装依赖时errno 4058安装不上了,老是报错超时

悲催的我基本上问题都遇到了。。。。。。一、npm安装依赖失败问题问题描述:错误信息: unbuild: sill gentlyRm target.inParent = false后续会出现长时间停留问题解决:删除整个node_modules,重新npm install二、 npm lockfile报错问题描述:这个是因为版本问题导致的提示信息。错误信息:npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
问题解决: 忽略它。这只是一个警告,所发生的npm只是向package-lock.json文件添加信息。
npm在生产中降级到旧版本。考虑运行npm版本 6,npm i npm@6 -g 或者 npm -g install npm@6
如果已经安装了一个新版本的npm,要保留较新版本,使用旧版本运行一个npm命令,可以使用npx来执行。使用该-p标志来指定npm想要的版本。例如,即使安装了版本 7 ,运行npx -p npm@6 npm ci,也会使npm ci以npm版本 6运行。 三、npm ERR! code EPERM问题问题描述:这是因为在git bash here,vs code等第三方,不以管理员身份运行造成的问题,就根本来说git bash here是windows dos命令封装过的。但是cmd 以管理员身份运行就需要定位到相应文件夹操作(需要先进入相应盘,再进入相应文件,比较麻烦 ),但是从第三方进入就可以直接在相应文件夹下操作,这样也比较方便。错误信息:$ npm install
npm WARN tarball tarball data for typescript@3.0.3 (sha1-SFOz4nXs2qJ/eP2kbcJzp+t
/wcg=) seems to be corrupted. Trying one more time.
npm ERR! path E:ue-typescript
ode_modules.staging ypescript-10ba8b53lib y
pescriptServices.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'E:ue-typescript
ode_m
odules.staging ypescript-10ba8b53lib ypescriptServices.js'
npm ERR!
{ Error: EPERM: operation not permitted, unlink 'E:ue-typescript
od
e_modules.staging ypescript-10ba8b53lib ypescriptServices.js'
npm ERR!
cause:
npm ERR!
{ Error: EPERM: operation not permitted, unlink 'E:ue-typescript
ode_modules.staging ypescript-10ba8b53lib ypescriptServices.js'
npm ERR!
errno: -4048,
npm ERR!
code: 'EPERM',
npm ERR!
syscall: 'unlink',
npm ERR!
path: 'E:\vue-typescript
ode_modules.staging\typescript-10ba8b53\lib\typescriptServices.js’ },npm ERR! stack: 'Error: EPERM: operation not permitted, unlink ‘E:\vue-typescriptode_modules.staging\typescript-10ba8b53\lib\typescriptServices.js’',npm ERR! errno: -4048,npm ERR! code: ‘EPERM’,npm ERR! syscall: ‘unlink’,npm ERR! path: ‘E:\vue-typescriptode_modules.staging\typescript-10ba8b53\lib\typescriptServices.js’,npm ERR! parent: ‘hello-world’ }npm ERR!npm ERR! The operation was rejected by your operating system.npm ERR! It’s possible that the file was already in use (by a text editor or antivirus),npm ERR! or that you lack permissions to access it.npm ERR!npm ERR! If you believe this might be a permissions issue, please double-check thenpm ERR! permissions of the file and its containing directories, or try runningnpm ERR! the command again as root/Administrator (though this is not recommended).问题解决:需要删除.npmrc文件强调:不是nodejs安装目录npm模块下的那个npmrc文件而是在C:Users{账户}下的.npmrc文件eg: 我的是C:Userszhuzhu,下面有一个.npmrc四、 npm ERR! code EEXIST(文件已存在,拒绝删除)问题描述:npm ERR! code EEXIST
npm ERR! File exists: E:software
ode.js
ode_globalue
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
如提示,加入–force强制执行问题解决:清理缓存npm cache clean --force 或者清理node_cache缓存重新执行全局安装或者强制执行npm install @vue/cli -g或者npm install -g @vue/cli --force
一、错误描述E:\Projects\demo>npm install
...
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!
<https://npm.community>
npm ERR! A complete log of this run can be found in:
npm ERR!
C:\Users\yanno\AppData\Roaming\npm-cache\_logs\2020-06-05T06_32_32_608Z-debug.log
二、问题原因在这个地方找到了关于这个问题的讨论 链接,看了半天都没有明确说出是什么原因,但提供了一个解决办法:清除npm缓存,升级npm,然后重新执行npm install三、尝试解决环境:操作系统 windwos 10.0.18363、node v14.2.0、npm 6.14.4删除缓存PS C:\Users\administrator> npm cache clean -f
npm WARN using --force I sure hope you know what you are doing.
升级npm (从6.14.4升级到了6.14.5)PS C:\Users\administrator> npm install -g npm
D:\Develope Files\SDK\node\modules\npm -> D:\Develope Files\SDK\node\modules\node_modules\npm\bin\npm-cli.js
D:\Develope Files\SDK\node\modules\npx -> D:\Develope Files\SDK\node\modules\node_modules\npm\bin\npx-cli.js
+ npm@6.14.5
updated 1 package in 30.183s
项目根目录npm installE:\Projects\demo>npm install
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
[
...........] / postinstall: sill install executeActions
然后一直卡住不动了,感觉不太行 删除项目下的node_modules文件夹,清理缓存再次安装,出现最初的错误
继续找其他办法,这上面说升级Node到最新的稳定版本解决了问题a. 升级Node,Windows升级node只能安装覆盖,具体办法b. npm的全局设置,具体办法c. 再次安装项目依赖还是不行!!!!!
完全卸载nodejs和npm,并重新安装,不报错了!!!

我要回帖

更多关于 npm安装依赖时errno 4058 的文章

 

随机推荐