ignite: Doesn't work on latest npm

Click to expand
/home/quantum/.npm/_npx/e31027f3785124a8/node_modules/gluegun/build/index.js:13
    throw up;
    ^
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: pizza-app@0.0.1
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0" from @react-native-community/masked-view@0.1.10
npm ERR! node_modules/@react-native-community/masked-view
npm ERR!   @react-native-community/masked-view@"0.1.10" 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/quantum/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/quantum/.npm/_logs/2021-08-24T14_57_43_808Z-debug.log

(Use `node --trace-uncaught ...` to show where the exception was thrown)
~/Desktop/projects took 2s ✗  npm -v                     
7.21.0
0 verbose cli [
0 verbose cli   '/home/quantum/.fnm/node-versions/v16.7.0/installation/bin/node',
0 verbose cli   '/home/quantum/.fnm/node-versions/v16.7.0/installation/bin/npm',
0 verbose cli   'install'
0 verbose cli ]
1 info using npm@7.21.0
2 info using node@v16.7.0
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 0ms
5 timing config:load:file:/home/quantum/.fnm/node-versions/v16.7.0/installation/lib/node_modules/npm/npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 0ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:/home/quantum/Desktop/projects/PizzaApp/.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:/home/quantum/.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:/home/quantum/.fnm/node-versions/v16.7.0/installation/etc/npmrc Completed in 0ms
14 timing config:load:global Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 0ms
18 timing config:load Completed in 4ms
19 timing npm:load:configload Completed in 4ms
20 timing npm:load:setTitle Completed in 0ms
21 timing npm:load:setupLog Completed in 0ms
22 timing config:load:flatten Completed in 2ms
23 timing npm:load:cleanupLog Completed in 1ms
24 timing npm:load:configScope Completed in 0ms
25 timing npm:load:projectScope Completed in 0ms
26 timing npm:load Completed in 8ms
27 timing arborist:ctor Completed in 0ms
28 timing arborist:ctor Completed in 0ms
29 timing idealTree:init Completed in 7ms
30 timing idealTree:userRequests Completed in 0ms
31 silly idealTree buildDeps
32 silly fetch manifest @react-native-async-storage/async-storage@^1.14.1
33 http fetch GET 200 https://registry.npmjs.org/@react-native-async-storage%2fasync-storage 789ms (cache miss)
34 silly fetch manifest react-native@0.64.2
35 http fetch GET 200 https://registry.npmjs.org/react-native 199ms (cache revalidated)
36 silly fetch manifest react@17.0.1
37 http fetch GET 200 https://registry.npmjs.org/react 191ms (cache revalidated)
38 silly fetch manifest @react-native-community/masked-view@0.1.10
39 http fetch GET 200 https://registry.npmjs.org/@react-native-community%2fmasked-view 242ms (cache miss)
40 silly fetch manifest react@^16.0
41 timing idealTree Completed in 1452ms
42 timing command:install Completed in 1462ms
43 verbose stack Error: unable to resolve dependency tree
43 verbose stack     at Arborist.[failPeerConflict] (/home/quantum/.fnm/node-versions/v16.7.0/installation/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1274:25)
43 verbose stack     at Arborist.[loadPeerSet] (/home/quantum/.fnm/node-versions/v16.7.0/installation/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1241:34)
43 verbose stack     at async Arborist.[buildDepStep] (/home/quantum/.fnm/node-versions/v16.7.0/installation/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:877:11)
43 verbose stack     at async Arborist.buildIdealTree (/home/quantum/.fnm/node-versions/v16.7.0/installation/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:206:7)
43 verbose stack     at async Promise.all (index 1)
43 verbose stack     at async Arborist.reify (/home/quantum/.fnm/node-versions/v16.7.0/installation/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:147:5)
43 verbose stack     at async Install.install (/home/quantum/.fnm/node-versions/v16.7.0/installation/lib/node_modules/npm/lib/install.js:150:5)
44 verbose cwd /home/quantum/Desktop/projects/PizzaApp
45 verbose Linux 5.11.0-7620-generic
46 verbose argv "/home/quantum/.fnm/node-versions/v16.7.0/installation/bin/node" "/home/quantum/.fnm/node-versions/v16.7.0/installation/bin/npm" "install"
47 verbose node v16.7.0
48 verbose npm  v7.21.0
49 error code ERESOLVE
50 error ERESOLVE unable to resolve dependency tree
51 error
52 error While resolving: pizza-app@0.0.1
52 error Found: react@17.0.1
52 error node_modules/react
52 error   react@"17.0.1" from the root project
52 error
52 error Could not resolve dependency:
52 error peer react@"^16.0" from @react-native-community/masked-view@0.1.10
52 error node_modules/@react-native-community/masked-view
52 error   @react-native-community/masked-view@"0.1.10" from the root project
52 error
52 error Fix the upstream dependency conflict, or retry
52 error this command with --force, or --legacy-peer-deps
52 error to accept an incorrect (and potentially broken) dependency resolution.
52 error
52 error See /home/quantum/.npm/eresolve-report.txt for a full report.
53 verbose exit 1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 5
  • Comments: 19 (11 by maintainers)

Most upvoted comments

@Andrewngabriel Are you for sure running ignite create? Because the proper command should be npx ignite-cli new MyApp.

If you’re using the latter, someone in the Infinite Red Community reported that this command fixed it for them…oddly.

npx @react-native-community/cli doctor

I don’t know why. 🤷

Link to comment (will expire): https://infiniteredcommunity.slack.com/archives/C41PK1LAY/p1631412151028900

Just wanted to add, for anyone running into this same issue. Deleting the folder containing the broken application, installing yarn and re-running the command will resolve the issue. Probably makes sense to just use yarn if the boilerplate you’re relying on prefers it 😃.

I was trying to run ignite new AppName when I got the error mentioned above.

Interesting enough, I just tried to run npx @react-native-community/cli doctor like you advised and got the following output:

⠸ Running diagnostics...
warn We couldn't find a package.json in this directory. Android SDK checks may fail. Doctor works best in a React Native project root.
Common
 ✓ Node.js
 ✖ yarn
   - Version found: N/A
   - Version supported: >= 1.10.x
 ✓ npm
 ✖ Watchman - Used for watching changes in the filesystem when in development mode
   - Version found: 2021.08.30.00
   - Version supported: 4.x

Android
 ✓ JDK
 ✓ Android Studio - Required for building and installing your app on Android
 ✖ Android SDK - Required for building and installing your app on Android
   - Versions found: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0
   - Version supported: Not Found
 ✓ ANDROID_HOME

iOS
 ✓ Xcode - Required for building and installing your app on iOS
 ✓ CocoaPods - Required for installing iOS dependencies
 ✓ ios-deploy - Required for installing your app on a physical device with the CLI

Errors:   3
Warnings: 0

I pressed e to let the tool try and fix all the errors it flagged and it was able to fix obtaining yarn and Watchman but had some trouble with Android SDK

Attempting to fix 3 issues...

Common
 ✔ yarn
 ✔ Watchman

Android
 ✖ Android SDK
   Read more about how to update Android SDK at https://developer.android.com/studio

Afterwards everything magically started working again though when I tried installing dependencies for this repo by running npm install, I got the following warning while installing packages.

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: ts-jest@27.0.4
npm WARN Found: @types/jest@27.0.1
npm WARN node_modules/@types/jest
npm WARN   dev @types/jest@"^27.0.1" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peerOptional @types/jest@"^26.0.0" from ts-jest@27.0.4
npm WARN node_modules/ts-jest
npm WARN   dev ts-jest@"^27.0.4" from the root project
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.

added 953 packages, and audited 1211 packages in 49s

100 packages are looking for funding
  run `npm fund` for details

6 vulnerabilities (2 low, 2 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

I think this issue might be caused due to not having a package-lock.json file so npm users fetch dependencies fresh each time they run npm install whereas with yarn, because you have a lock file, it can fetch packages in a more stable approach. Is there a reason for not having a package-lock.json?

As an OSS maintainer myself, I know the struggle. Thank you is the word we don’t hear enough, so: thank you!

cat-cute

I am not frustrated but delighted to hear the project is active. When I saw there are workarounds I closed them. As it is open-source it doesn’t impact me if it’s not maintained due to various circumstances. I made a spurious assumption so I take my words back regarding maintenance

@shirshak55 While I understand your frustration with an issue that hasn’t been resolved in four months, I do take issue with the idea that the project isn’t active. We’ve been working on it as time allows, and I have a PR in-progress that addresses both the NPM issue and also supports PNPM as well as Yarn and NPM.

https://github.com/infinitered/ignite/pull/1847