Общий код Nativescript - требования - angular9 не работает - PullRequest
4 голосов
/ 21 июня 2020

Может быть, «общий код» не сочетается с последней Angular -Cli 9?

Я получаю с помощью этой команды:

ng new MyApp --collection @ nativescript / schematics --shared --sample

Следующее сообщение об ошибке :

npm ПРЕДУПРЕЖДЕНИЕ устарело fsevents@1.2.13: fsevents 1 сломается на узле v14 + и может использовать небезопасные двоичные файлы. Обновите до fsevents 2. npm WARN устарело resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm ERR! код ETARGET npm ERR! notarget Не найдено подходящей версии для @ angular / http @ ~ 9.1.0. npm ОШИБКА! notarget В большинстве случаев вы или одна из ваших зависимостей запрашиваете npm ERR! notarget версию пакета, которая не существует. npm ОШИБКА! notarget npm ERR! notarget Он был указан как зависимость от 'CommunityPlanner' npm ERR! notarget

npm ERR! Полный журнал этого запуска можно найти в: npm ERR! C: \ Users \ patri \ AppData \ Roaming \ npm -cache_logs \ 2020-06-21T09_33_18_448Z-debug.log × Не удалось установить пакет, см. Выше. Сбой рабочего процесса Schemati c. См. Выше.

Ответы [ 2 ]

2 голосов
/ 26 июня 2020

В настоящее время это проблема схемы зависимостей nativescript. Источник: https://github.com/NativeScript/nativescript-schematics/issues/278

@ angular / http устарел и не имеет версии 9, вместо этого http-библиотеки находятся внутри @ angular / common.

Обходной путь:
После запуска ng new MyApp --collection @nativescript/schematics --shared --sample ваша папка проекта должна быть создана.

Go для упаковки. json в папке вашего проекта

  1. Удалить @ angular / http в разделе «зависимости»
  2. Изменить «@ nativescript / schematics»: «~ 2.0.0» на «@ nativescript / schematics»: «~ 9.0.0 " в разделе" devDependencies "
0 голосов
/ 02 августа 2020

У меня такая же (но хуже) проблема. Нормальный проект nativescript angular строится нормально. После запуска ng new MyApp --collection @nativescript/schematics --shared --sample

Получите эту ошибку:

Installing packages...npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @angular/http@~9.1.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget It was specified as a dependency of 'myProject'
npm ERR! notarget 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2020-08-02T07_34_55_277Z-debug.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.

...