当我想安装新的依赖项时,出现此错误:
Can not install Node.js module: /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js install react-native-datepicker --save
Standard error:
npm WARN checkPermissions Missing write access to /home/akezhan/ Рабочий стол/work/hackathon/BDonor/BDonor-front/node_modules
npm WARN eslint-plugin-react-native@3.3.0 requires a peer of eslint@^3.17.0 || ^4 || ^5 but none is installed. You must install peer dependencies yourself.
npm WARN expo-camera@1.1.0 requires a peer of react@^16.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN expo-gl@1.0.2 requires a peer of react@^16.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-maps@0.21.0 requires a peer of react-native@^0.51 || ^0.52 || ^0.53 || ^0.54 but none is installed. You must install peer dependencies yourself.
npm WARN react-native-reanimated@1.0.0-alpha.6 requires a peer of react@16.0.0-alpha.6 but none is installed. You must install peer dependencies yourself.
答案 0 :(得分:1)
这是一个权限问题。 更好的是使用
sudo npm install *package_name*
在某些情况下,删除您的node_modules文件夹也可以。
rm -rf node_modules