【问题标题】:Why does npm isntallation of styled-components for React Native fail?为什么 npm 为 React Native 安装 styled-components 会失败?
【发布时间】:2021-05-24 12:54:06
【问题描述】:

我正在尝试为 React Native 项目安装样式化组件:

C:\Projects\Native1>npm install --save styled-components

安装失败并出现以下错误:

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Projects\Native1\node_modules\camelize
npm ERR! dest C:\Projects\Native1\node_modules\.camelize.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Projects\Native1\node_modules\camelize' -> 'C:\Projects\Native1\no
de_modules\.camelize.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

node_modules 文件夹中确实不存在该目录。怎样才能成功安装模块?

【问题讨论】:

    标签: react-native npm styled-components


    【解决方案1】:

    从你的 nodemodules 文件夹中清理缓存

    npm 缓存清理 --force

    或者

    删除你的 nodemodules 文件夹

    然后运行

    npm i 样式化组件

    【讨论】:

      猜你喜欢
      • 2018-10-13
      • 2018-07-19
      • 2019-08-06
      • 1970-01-01
      • 1970-01-01
      • 2018-03-06
      • 2020-01-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多