将节点从6升级到最新版本时,NPM I在REACT本机项目中出现ENOENT失败 [英] When upgrading node from 6 to latest, npm i fails with ENOENT in react native project

查看:0
本文介绍了将节点从6升级到最新版本时,NPM I在REACT本机项目中出现ENOENT失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Reaction本机项目上将NPM从6.14升级到最新版本时

使用节点14,NVM切换节点版本,理想情况下,我希望转到节点16,但在更新NPM时,无论是14还是16,都会发生类似的问题。

我还在Mac M1上使用自制软件

我注意到Jetify命令询问我:

Jetifier找到了1390个要转发的文件。使用8名工人... 需要安装以下程序包: 豆荚 可以继续吗?(Y)

当我选择y时,NPM I失败。我已经清除了缓存并删除了node_MODULES。正常的缓存清除尝试似乎不起作用。

npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /Users/user/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/user/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2'
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!     /Users/user/.npm/_logs/2022-01-28T21_51_28_303Z-debug-0.log
npm ERR! code 254
npm ERR! path /Users/user/repos/MyApp/My-MobileApp
npm ERR! command failed
npm ERR! command sh -c npx jetify && cd ios && npx pod install && cd .. && ./node_modules/.bin/patch-package

以下是完整日志的一部分-

    3325 timing reify:rollback:retireShallow Completed in 0ms
3326 timing command:exec Completed in 42372ms
3327 verbose stack Error: ENOENT: no such file or directory, chmod '/Users/user/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2'
3328 verbose cwd /Users/user/repos/MyApp/MyApp-MobileApp/ios
3329 verbose Darwin 21.2.0
3330 verbose argv "/Users/user/.nvm/versions/node/v14.18.3/bin/node" "/Users/user/.nvm/versions/node/v14.18.3/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "pod" "install"
3331 verbose node v14.18.3
3332 verbose npm  v8.4.0
3333 error code ENOENT
3334 error syscall chmod
3335 error path /Users/user/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2
3336 error errno -2
3337 error enoent ENOENT: no such file or directory, chmod '/Users/user/.npm/_npx/a0ca5f5666585aa2/node_modules/pod/node_modules/pm2/bin/pm2'
3338 error enoent This is related to npm not being able to find a file.
3338 error enoent
3339 verbose exit -2
3340 timing npm Completed in 42533ms
3341 verbose unfinished npm timer reify 1643406718315
3342 verbose unfinished npm timer reify:build 1643406730346
3343 verbose unfinished npm timer build 1643406730346
3344 verbose unfinished npm timer build:deps 1643406730347
3345 verbose unfinished npm timer build:link 1643406730354
3346 verbose unfinished npm timer build:link:node_modules/pod 1643406730356
3347 verbose code -2
3348 error A complete log of this run can be found in:
3348 error     /Users/user/.npm/_logs/2022-01-28T21_51_28_303Z-debug-0.log

推荐答案

尝试npm rebuild他们说只有在升级节点版本且必须重新编译时才使用<<2-0]

这篇关于将节点从6升级到最新版本时,NPM I在REACT本机项目中出现ENOENT失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆