npm ERR! Maximum call stack size exceeded

记录自己写react native 所遇到的坑,最近老出问题。也是很难受了。

在自己init新项目后,需要下载一些组件于是报下了以下错误。

E:\Demo>npm install react-native-deprecated-custom-components --save

npm WARN deprecated istanbul-lib-hook@1.2.1: 1.2.0 should have been a major version bump
npm WARN rm not removing E:\Demo\node_modules\.bin\uuid.cmd as it wasn't installed by E:\Demo\node_modules\uuid
npm WARN rm not removing E:\Demo\node_modules\.bin\uuid as it wasn't installed by E:\Demo\node_modules\uuid
npm WARN eslint-plugin-react-native@3.2.1 requires a peer of eslint@^3.17.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! Maximum call stack size exceeded

npm ERR! A complete log of this run can be found in:

npm ERR!     C:\Users\hp\AppData\Roaming\npm-cache\_logs\2018-07-10T11_44_08_949Z-debug.log

报错:超过最大调用栈,看得一脸懵逼。最后是通过降级npm解决的,百度说可以npm版本升级降级都可以,但是我升级没有解决问题,降级成功了。

降级:npm install -g npm@5.4.0

升级:npm install -g npm

降级完后下载完我要的插件后,就又开心的启动项目准备写我的项目了。但是它又又又又报错了!

错误类似如下,还好只是个小问题。

E:\Demo>react-native run-android
Command start unrecognized.  Make sure that you have run npm install' and that you are inside a react native project . 

错误提示就是重新npm install一下就好啦。但是!

我又遇到如下错误:(界面不小心关了,这是日志)

4218 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\hp\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
4219 verbose node v8.11.3
4220 verbose npm  v5.4.0
4221 error path E:\Demo\node_modules\fsevents\node_modules\ansi-regex\package.json
4222 error code EPERM
4223 error errno -4048
4224 error syscall unlink
4225 error Error: EPERM: operation not permitted, unlink 'E:\Demo\node_modules\fsevents\node_modules\ansi-regex\package.json'
4225 error  { Error: EPERM: operation not permitted, unlink 'E:\Demo\node_modules\fsevents\node_modules\ansi-regex\package.json'
4225 error   stack: 'Error: EPERM: operation not permitted, unlink \'E:\\Demo\\node_modules\\fsevents\\node_modules\\ansi-regex\\package.json\'',
4225 error   errno: -4048,
4225 error   code: 'EPERM',
4225 error   syscall: 'unlink',
4225 error   path: 'E:\\Demo\\node_modules\\fsevents\\node_modules\\ansi-regex\\package.json' }
4226 error Please try running this command again as root/Administrator.

4227 verbose exit [ -4048, true ]

这就非常难受了,在边玩植物大战僵尸边百度的情况下还是找到了解决办法。错误就是需要你升级npm,就是你刚刚降级了npm,现在又要升级回去。

降级:npm install -g npm@5.4.0

升级:npm install -g npm

现在的最新版本是6.1.0(2018-7-10)

我的步骤:

1.进入自己的项目

2.降级npm

3.下载自己需要的插件

4.升级npm

5. npm install

6.react-native run-android

注:都是进入自己的项目里进行的。其中查看npm版本的命令 npm-v,可以升降级后查看是否成功。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值