Я пытался создать проект совместного использования кода Angular с помощью Native Script. Вот мои текущие системные характеристики:
nativescript -version
6.8.0-r c .4
Angular CLI: 10.0.2
Узел: 10.22.0
ОС: darwin x6
@ nativescript / schematics@10.0.2
Когда я запускаю tns doctor:
Jasons-MacBook -Pro: владелец рабочего стола $ tns doctor
✔ Getting environment information
No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.0.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 6.8.0-rc.4 and the latest available version is 6.8.0.
Для инициализации проекта я запускаю следующую команду:
ng new --collection=@nativescript/schematics project-name --shared
Проект успешно создается, но консоль возвращается с этим:
⠴ 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.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
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 WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
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 'project-name'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/owner/.npm/_logs/2020-08-02T02_31_24_911Z-debug.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.
Owners-MacBook-Pro:Desktop owner$
В документации я вижу это примечание: ПРИМЕЧАНИЕ: Если указанная выше команда не работает, убедитесь, что у вас нет недопустимого файла конфигурации в вашем домашнем каталоге (/ home / user-name /. angular. json). Пожалуйста, удалите файл и снова запустите команду.
Но я не уверен, применимо ли это к моему случаю, а если да, то я не уверен, где найти этот файл. Если проект не был создан, находится ли этот файл где-нибудь в моей системе?
Примечание: при запуске этой команды проекты никогда не содержат папку «node modules». Это имеет смысл, потому что когда я запускаю 'ng g c [имя-компонента]', я получаю следующую ошибку:
An unhandled exception occurred: Cannot find module '@schematics/angular/utility/parse-name'
Я также получаю эту ошибку, когда есть папка 'node modules' и там присутствует @ schematics / angular / utility / parse-name (ts и d.ts).
Я упомянул и попробовал множество онлайн-потоков, чтобы исправить это, и, честно говоря, намотал часть Native Script в мой мозг в клубке пряжи.
Ресурсы, на которые я ссылался и пробовал:
https://docs.nativescript.org/angular/code-sharing/creating-a-new-project
https://github.com/NativeScript/nativescript-schematics/pull/286
https://github.com/NativeScript/nativescript-schematics/issues/241
Заранее благодарю вас за вашу помощь. Я очень ценю это!