nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

Angular Project creation fails with dependency issues on Node 15

Open csivaprasadc opened this issue 5 years ago • 15 comments

─○ ns create Error while loading nativescript-cloud is: Default commands should be required before child commands

Let’s create a NativeScript app!

Answer the following questions to help us build the right app for you. (Note: you can skip this prompt next time using the --template option, or the --ng, --react, --vue, --svelte, --ts, or --js flags.)

? First, what will be the name of your app? *******

? Next, which style of NativeScript project would you like to use: Angular

? Finally, which template would you like to start from: Tabs npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: @nativescript/[email protected] npm ERR! Found: [email protected] npm ERR! node_modules/zone.js npm ERR! zone.js@"~0.11.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer zone.js@"~0.10.3" from @angular/[email protected] npm ERR! node_modules/@angular/core npm ERR! @angular/core@"~11.0.0" from the root project npm ERR! peer @angular/core@"11.0.4" from @angular/[email protected] npm ERR! node_modules/@angular/animations npm ERR! @angular/animations@"~11.0.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.

Angular CLI version Angular CLI: 11.0.4 Node: 15.3.0 OS: darwin x64

Nativescript CLI version ╰─○ ns --version 7.0.11

csivaprasadc avatar Dec 12 '20 06:12 csivaprasadc

Wanted to try out NS today but this greeted me.

AlexAegis avatar Dec 16 '20 15:12 AlexAegis

Using @nativescript/schematics also resulted in the same error

ng new --collection=@nativescript/schematics my-mobile-app

⠙ Installing packages (npm)...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/zone.js npm ERR! zone.js@"~0.11.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer zone.js@"~0.10.3" from @angular/[email protected] npm ERR! node_modules/@angular/core npm ERR! @angular/core@"~11.0.0" from the root project npm ERR! peer @angular/core@"11.0.5" from @angular/[email protected] npm ERR! node_modules/@angular/animations npm ERR! @angular/animations@"~11.0.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.

csivaprasadc avatar Dec 17 '20 05:12 csivaprasadc

Finally resolved the issue by installing the node LTS version

v14.15.2

csivaprasadc avatar Dec 17 '20 10:12 csivaprasadc

That's a non solution, it should work on Node 15. Could you please reopen the ticket and rename it so the title includes "on Node 15"? @csivaprasadc

AlexAegis avatar Dec 17 '20 11:12 AlexAegis

@AlexAegis As requested, I reopened the issue.

csivaprasadc avatar Jan 26 '21 06:01 csivaprasadc

I'm running into a very similar problem. New install of WSL2 with Ubuntu 20.04 LTS, latest LTS nodejs (v15.7.0) and angular 11: Angular CLI: 11.0.4 Node: 15.7.0 OS: linux x64

Angular: ... Ivy Workspace:

Package Version

@angular-devkit/architect 0.1100.4 (cli-only) @angular-devkit/core 11.0.4 (cli-only) @angular-devkit/schematics 11.0.4 (cli-only) @schematics/angular 11.0.4 (cli-only) @schematics/update 0.1100.4 (cli-only)

command: ng new [project name]

output:

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: @angular/[email protected] npm ERR! node_modules/@angular/compiler npm ERR! @angular/compiler@"~11.0.4" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @angular/compiler@"11.1.1" from @angular/[email protected] npm ERR! node_modules/@angular/compiler-cli npm ERR! peer @angular/compiler-cli@"^11.0.0" from @angular-devkit/[email protected] npm ERR! node_modules/@angular-devkit/build-angular 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.

Had to go into the project directory and run the suggested command to fix the problem: npm install --legacy-peer-deps

When I did I got the following warnings:

npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2" npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. npm WARN deprecated [email protected]: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.

A command this simple should not fail, and definitely not this spectacularly.

jyurkiw avatar Jan 30 '21 01:01 jyurkiw

https://github.com/NativeScript/nativescript-cli/issues/5482#issuecomment-765526592

rigor789 avatar Jan 30 '21 10:01 rigor789

i m getting the same error i even uninstalled node then cleared cache.even though i m unable to solve this problem please hel

Saurabhhhh4 avatar May 24 '21 03:05 Saurabhhhh4

Seriously cant be the only people getting this?

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/zone.js npm ERR! zone.js@"~0.11.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer zone.js@"~0.10.3" from @angular/[email protected] npm ERR! node_modules/@angular/core npm ERR! @angular/core@"~11.0.0" from the root project npm ERR! peer @angular/core@"11.0.9" from @angular/[email protected] npm ERR! node_modules/@angular/animations npm ERR! @angular/animations@"~11.0.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 /Users/raybell/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! /Users/raybell/.npm/_logs/2021-06-04T02_29_58_669Z-debug.log ✖ Package install failed, see above. The Schematic workflow failed. See above.

ray-gametimehero avatar Jun 04 '21 02:06 ray-gametimehero

Im having the same issue.

CameronMcCleveAvercast avatar Jun 09 '21 20:06 CameronMcCleveAvercast

I am having the same issue. Tried changing the versions but still same. Any help would be greatly appreciated.

kedar2594 avatar Jul 09 '21 11:07 kedar2594

Having the same issue, upgrading to 14.15.2 didn't help...

assemnabill avatar Aug 01 '21 16:08 assemnabill

I still have the issue here.

Angular CLI: 12.2.10 Node: 16.12.0 (Unsupported) Package Manager: npm 8.1.0

Even with Node 14 and 15 the installation failed.

| Installing packages (npm)...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/zone.js
npm ERR!   zone.js@"~0.11.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer zone.js@"~0.10.3" from @angular/[email protected]
npm ERR! node_modules/@angular/core
npm ERR!   @angular/core@"~11.0.0" from the root project
npm ERR!   peer @angular/core@"11.0.9" from @angular/[email protected]
npm ERR!   node_modules/@angular/animations
npm ERR!     @angular/animations@"~11.0.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.```

Lqvrent avatar Oct 20 '21 20:10 Lqvrent

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/zone.js npm ERR! zone.js@"0.11.3" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer zone.js@"~0.11.4" from @angular/[email protected] npm ERR! node_modules/@angular/core npm ERR! @angular/core@"^12.2.0" from the root project npm ERR! peer @angular/core@"12.2.11" from @angular/[email protected] npm ERR! node_modules/@angular/animations npm ERR! @angular/animations@"^12.2.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 C:\Users\prave\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\prave\AppData\Local\npm-cache_logs\2021-10-24T06_22_00_159Z-debug.log

I'm also facing the same error when I tried to do npm i, why this error is occurring ?

My Node Version is 16.9.0

Praveen111 avatar Oct 24 '21 06:10 Praveen111

What command is this happening with? Creating a new project with ns create myCoolNGApp --ng works without issues:

> node -v
v17.0.1

> npm -v
8.1.0

> ns -v
8.1.4
✔ Up to date.

> ns create myCoolNGApp --ng
Project myCoolNGApp was successfully created.

Now you can navigate to your project with cd myCoolNGApp and then:

Run the project on multiple devices:

  $ ns run ios
  $ ns run android

Debug the project with Chrome DevTools:

  $ ns debug ios
  $ ns debug android

For more options consult the docs or run ns --help

Running ns clean and then npm i again also works fine.

rigor789 avatar Oct 25 '21 10:10 rigor789