Miguel Herreros Cejas
Miguel Herreros Cejas

Reputation: 674

Issues Installing Vue-Native with library vue-native-scripts

I am trying to create a project with Vue-Native following the instructions in the documentation:

https://vue-native.io/docs/installation.html

I am trying it with Expo and Vue-React, and in both cases I have the same error when I run "npm start":

Failed to construct transformer:  Error: Cannot find module 'vue-native-scripts'

I try to install it with npm install vue-native-scripts --save-dev and I have the error:

 npm ERR! code ERESOLVE
 npm ERR! ERESOLVE unable to resolve dependency tree
 npm ERR! 
 npm ERR! While resolving: [email protected]
 npm ERR! Found: [email protected]
 npm ERR! node_modules/react
 npm ERR!   react@"16.13.1" from the root project
 npm ERR! 
 npm ERR! Could not resolve dependency:
 npm ERR! peer react@"17.0.1" from [email protected]
 npm ERR! node_modules/react-native
 npm ERR!   react-native@"^0.64.0" from the root project
 npm ERR! 
 npm ERR! Fix the upstream dependency conflict, or retry
 npm ERR! this command with --force, or --legacy-peer-deps
 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
 npm ERR! 
 npm ERR! See /home/miguel/.npm/eresolve-report.txt for a full report.
 npm ERR! A complete log of this run can be found in:
 npm ERR!     /home/miguel/.npm/_logs/2021-04-04T10_52_07_169Z-debug.log

I updated all libraries: React, React-Native, npm, Node, etc. But I have the same error.

Upvotes: 1

Views: 492

Answers (1)

Mawlicious
Mawlicious

Reputation: 34

I am currently working on a vue-native project and encountered this problem when I started.

This seems to be a problem about the dependencies of a vue-native project having sub dependencies of different versions from other dependencies. When NPM sees this it just freaks out.

My solution is to start using yarn! Install it by the following:

$ npm i -g yarn

After its installed, its advised that you delete the project and redo the vue-native-cli init command so it can use yarn from there, but you can also just directly use the following command without deleting the project:

$ yarn install vue-native-scripts

Upvotes: 1

Related Questions