Npm install - dependency conflicts on full stack template - ERESOLVE unable to resolve dependency tree

Hi,

we recently upgraded our react application from 2022.02 (all working fine) to 2022.06 and have been experiencing dependency conflicts when trying to run npm install:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @com.mgmtp.a12.workflows/workflows-client@8.0.6
npm ERR! Found: react-dnd@15.1.2
npm ERR! node_modules/react-dnd
npm ERR!   react-dnd@"^15.1.2" from the root project
npm ERR!   peer react-dnd@"^15.1.2" from @com.mgmtp.a12.widgets/widgets-core@34.6.0
npm ERR!   node_modules/@com.mgmtp.a12.widgets/widgets-core
npm ERR!     @com.mgmtp.a12.widgets/widgets-core@"34.6.0" from the root project
npm ERR!     peer @com.mgmtp.a12.widgets/widgets-core@"^34.3.0" from @com.mgmtp.a12.client/client-core@12.3.0
npm ERR!     node_modules/@com.mgmtp.a12.client/client-core
npm ERR!       @com.mgmtp.a12.client/client-core@"12.3.0" from the root project
npm ERR!       1 more (@com.mgmtp.a12.workflows/workflows-client)
npm ERR!     3 more (@com.mgmtp.a12.formengine/formengine-core, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-dnd@"~14" from @com.mgmtp.a12.workflows/workflows-client@8.0.6
npm ERR! node_modules/@com.mgmtp.a12.workflows/workflows-client
npm ERR!   @com.mgmtp.a12.workflows/workflows-client@"8.0.6" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react-dnd@14.0.5
npm ERR! node_modules/react-dnd
npm ERR!   peer react-dnd@"~14" from @com.mgmtp.a12.workflows/workflows-client@8.0.6
npm ERR!   node_modules/@com.mgmtp.a12.workflows/workflows-client
npm ERR!     @com.mgmtp.a12.workflows/workflows-client@"8.0.6" 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 /Users/felix/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/felix/.npm/_logs/2022-11-03T14_01_28_702Z-debug-0.log

(see corresponding package.json attached)
package.json.txt (3.6 KB)

For comparison, I tried to run npm install on the freshly downloaded 2022.06.ext4 full stack template. I first get the following error:

npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
npm ERR! code ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! errno ENOTFOUND
npm ERR! network request to <INTERNAL_LINK> failed, reason: getaddrinfo ENOTFOUND <INTERNAL_LINK>
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/felix/.npm/_logs/2022-11-03T14_06_20_045Z-debug-0.log

and after deleting the package-lock.json file and running npm install again:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: @com.mgmtp.your-project-name/client@undefined
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!   peer react@"^16.14.0 || ^17.0.2" from @com.mgmtp.a12.client/client-core@12.3.0
npm ERR!   node_modules/@com.mgmtp.a12.client/client-core
npm ERR!     @com.mgmtp.a12.client/client-core@"12.3.0" from the root project
npm ERR!   6 more (@com.mgmtp.a12.formengine/formengine-core, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.3.0 || ^16.0.0-alpha" from react-virtualized@9.22.3
npm ERR! node_modules/react-virtualized
npm ERR!   peer react-virtualized@"^9.22.2" from @com.mgmtp.a12.formengine/formengine-core@34.6.0
npm ERR!   node_modules/@com.mgmtp.a12.formengine/formengine-core
npm ERR!     @com.mgmtp.a12.formengine/formengine-core@"34.6.0" from the root project
npm ERR!     1 more (@com.mgmtp.a12.client/client-core)
npm ERR!   react-virtualized@"^9.22.3" from @com.mgmtp.a12.widgets/widgets-core@34.5.0
npm ERR!   node_modules/@com.mgmtp.a12.widgets/widgets-core
npm ERR!     @com.mgmtp.a12.widgets/widgets-core@"34.5.0" from the root project
npm ERR!     2 more (@com.mgmtp.a12.client/client-core, @com.mgmtp.a12.formengine/formengine-core)
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 /Users/felix/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/felix/.npm/_logs/2022-11-03T14_08_54_866Z-debug-0.log

The only way I can get both, our react application and the full stack template, to run, is using npm install --force. But I don’t think that is the appropriate solution to deal with this problem…

Running node v14.19.1 and npm 8.13.2, on MacOS. But the same problem happens on Windows, with the same node version.

Hi, according to the fullstack-template README, the supported node/npm version is 14.x/6.x.
Npm 7+ introduced changes to the way peerDependecies are resolved, which is breaking in the fullstack template (see this overall ticket A12-13264, there is a comment describing similar problems).

Thank you! Downgrading to npm v6 solved the problem.