react-native学习 npm install出错

通骁
2023-12-01
1、用npm install --save react-native-deprecated-custom-components 时报如下错误:
npm ERR! path E:\ASWorkspace\RNHelloWorld\node_modules\immutable
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'E:\ASWorkspace\RNHell
oWorld\node_modules\immutable' -> 'E:\ASWorkspace\RNHelloWorld\node_modules\.imm
utable.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent


解决办法:
先运行npm install -g cnpm --registry=https://registry.npm.taobao.org
再运行:npm install --save react-native-deprecated-custom-components 
哈哈哈,竟然成功了
再运行
npm install --save react-navigation  //通过npm安装最新版本的react-navigation
也木有ERR了
 类似资料: