Skip to content

ng new --collection=@nativescript/schematics test --shared #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tonydolony opened this issue Jun 26, 2020 · 5 comments
Closed

ng new --collection=@nativescript/schematics test --shared #283

tonydolony opened this issue Jun 26, 2020 · 5 comments

Comments

@tonydolony
Copy link

tonydolony commented Jun 26, 2020

Environment
package.json create by the command (ng new --collection=@nativescript/schematics test --shared)

{
  "name": "test",
  "nativescript": {
    "id": "org.nativescript.test"
  },
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "android": "tns run android --env.aot",
    "ios": "tns run ios --env.aot",
    "mobile": "tns run",
    "preview": "tns preview"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.1.0",
    "@angular/common": "~9.1.0",
    "@angular/compiler": "~9.1.0",
    "@angular/core": "~9.1.0",
    "@angular/forms": "~9.1.0",
    "@angular/http": "~9.1.0",
    "@angular/platform-browser": "~9.1.0",
    "@angular/platform-browser-dynamic": "~9.1.0",
    "@angular/router": "~9.1.0",
    "core-js": "^2.6.9",
    "@nativescript/angular": "~9.0.0",
    "@nativescript/core": "~6.5.5",
    "@nativescript/theme": "~2.2.1",
    "reflect-metadata": "~0.1.12",
    "rxjs": "~6.5.5",
    "tslib": "1.10.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular/cli": "~9.1.0",
    "@angular/compiler-cli": "~9.1.0",
    "@angular-devkit/build-angular": "~0.901.0",
    "@nativescript/schematics": "~2.0.0",
    "@nativescript/tslint-rules": "~0.0.5",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.4.1",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~3.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "nativescript-dev-webpack": "~1.5.0",
    "protractor": "~5.4.3",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.8.3"
  }
}

Describe the bug
After running ng new --collection=@nativescript/schematics test --shared project is created but the error appears:
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 'test'
npm ERR! notarget

ng --version giving me
@angular-devkit/architect 0.1000.0
@angular-devkit/core 10.0.0
@angular-devkit/schematics 10.0.0
@schematics/angular 10.0.0
@schematics/update 0.1000.0
rxjs 6.5.5

To Reproduce
Just run ng new --collection=@nativescript/schematics test --shared

Expected behavior
Created a project without bug

@sgehly
Copy link

sgehly commented Jul 3, 2020

I had luck installing from Github rather than npm - looks like the fix is just not bundled in a release yet:

npm install -g https://github.com/NativeScript/nativescript-schematics.git

ng new --collection=@nativescript/schematics name --shared --style=scss

@juangranados
Copy link

@sgehly thank you very much! After generate new project, you still have to run npm i @nativescript/schematic in order to run ng commands

@MFFoX
Copy link

MFFoX commented Jul 16, 2020

Another workaround can be found in this answer (ideal for those who followed the documentation and don't want to start over):

  1. Remove @angular/http under "dependencies"
  2. Change "@nativescript/schematics": "~2.0.0" to "@nativescript/schematics": "~9.0.0" under "devDependencies"
  3. Delete node_modules and reinstall with npm i

@cuzzea
Copy link

cuzzea commented Jul 20, 2020

Even after following @sgehly solution, and all the other fixes here and on stackoverfow, I couldn't get this to work and got error after error. I got stuck at

Error: EACCES: permission denied, scandir '//.fseventsd'
and
Error: EACCES: permission denied, scandir '//.PKInstallSandboxManager-SystemSoftware'

I want to specify that I am running on a mac, but the same issues appear when trying to run it on a node docker file. I tried it with different versions of node, angular, tns, etc.

I am just giving up after more than 1 day spent on this (full of frustrations) and I am hopping that somebody here can point me to an older version that works. I presume that I would need to manually install specific versions of angular/node/etc.

Thanks.

EDIT: or maybe somebody has a git with a stable version of the shared template that I can just clone, that would be great. Thanks again.

@NathanWalker
Copy link
Contributor

Fixed in latest release, please see here for instructions of use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants