Nativescript项目无法运行ng serve
如果尝试运行以下命令,则会发生以下情况:Nativescript项目无法运行ng serve,nativescript,nativescript-angular,Nativescript,Nativescript Angular,如果尝试运行以下命令,则会发生以下情况: ng serve An unhandled exception occurred: No projects support the 'serve' target. See "/tmp/ng-YKKFYj/angular-errors.log" for further details. 在angular.json、package.json、src文件夹等所在的同一目录中,请参阅: forest@forest:~/<project-path>$
ng serve
An unhandled exception occurred: No projects support the 'serve' target.
See "/tmp/ng-YKKFYj/angular-errors.log" for further details.
在angular.json、package.json、src文件夹等所在的同一目录中,请参阅:
forest@forest:~/<project-path>$ ls -lsa
total 380
4 drwxrwxr-x 8 forest forest 4096 dec 17 17:44 .
4 drwxrwxr-x 7 forest forest 4096 dec 17 16:20 ..
4 -rw-r--r-- 1 forest forest 383 okt 26 1985 angular.json
4 drwxrwxr-x 4 forest forest 4096 dec 12 14:16 App_Resources
4 -rw-r--r-- 1 forest forest 202 okt 26 1985 .editorconfig
4 -rw-r--r-- 1 forest forest 260 dec 17 15:43 .gitignore
4 drwxrwxr-x 5 forest forest 4096 dec 17 14:02 hooks
4 drwxr-xr-x 3 root root 4096 dec 13 15:41 .idea
12 -rw-r--r-- 1 forest forest 11368 okt 26 1985 LICENSE
20 drwxrwxr-x 567 forest forest 20480 dec 17 16:15 node_modules
4 -rw-r--r-- 1 forest forest 62 okt 26 1985 nsconfig.json
4 -rw-rw-r-- 1 forest forest 1315 dec 17 16:15 package.json
264 -rw-rw-r-- 1 forest forest 267877 dec 17 16:15 package-lock.json
4 drwxrwxr-x 3 forest forest 4096 dec 17 16:04 platforms
4 drwxrwxr-x 4 forest forest 4096 dec 17 15:26 src
4 -rw-r--r-- 1 forest forest 670 dec 17 16:34 tsconfig.json
4 -rw-r--r-- 1 forest forest 126 okt 26 1985 tsconfig.tns.json
4 -rw-r--r-- 1 forest forest 38 okt 26 1985 tsfmt.json
4 -rw-rw-r-- 1 forest forest 3093 dec 17 17:44 tslint.json
4 -rw-r--r-- 1 forest forest 1575 dec 12 18:16 tslint_old.json
16 -rw-rw-r-- 1 forest forest 14103 dec 17 13:23 webpack.config.js
forest@forest:~/<project-path>$ ng serve
An unhandled exception occurred: No projects support the 'serve' target.
See "/tmp/ng-dO1bgr/angular-errors.log" for further details.
不过,该项目可以为Android构建 您应该使用for code sharing project,它完成了Web和iOS/Android的所有设置
如果是从模板创建的,则可能需要手动配置项目以支持web。是否使用原理图创建项目?否。看来,要么我使用模板,要么我可以进行代码共享,而不是两者兼而有之?我认为,如果您不熟悉为web配置Angular JSON,那么应该使用schematics,然后从template复制代码。现在想得很多了:谢谢。如果你提供一个答案,我会接受它以QnA的方式结束这个问题。
$ng --version:
Angular CLI: 8.3.19
Node: 12.3.1
OS: linux x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
------------------------------------------------------
@angular-devkit/architect 0.803.19 (cli-only)
@angular-devkit/core 8.2.2
@angular-devkit/schematics 8.3.19 (cli-only)
@ngtools/webpack 8.2.2
@schematics/angular 8.3.19 (cli-only)
@schematics/update 0.803.19 (cli-only)
rxjs 6.5.3
typescript 3.5.3
webpack 4.27.1
$tns --version
6.2.2