angular.js - 为什么Angular2 Qucikstart,npm install老报错,npm start也运行不了?

浏览:44日期:2023-01-09

问题描述

cmd窗口报错如下:

node_modules/@angular/common/src/facade/promise.d.ts(12,149): error TS2304: Cannot find name ’Promise’.node_modules/@angular/common/src/facade/promise.d.ts(13,43): error TS2304: Cannot find name ’Promise’.node_modules/@angular/common/src/pipes/async_pipe.d.ts(34,38): error TS2304: Cannot find name ’Promise’.node_modules/@angular/compiler/src/directive_normalizer.d.ts(12,62): error TS2304: Cannot find name ’Promise’.node_modules/@angular/compiler/src/directive_normalizer.d.ts(13,95): error TS2304: Cannot find name ’Promise’.node_modules/@angular/compiler/src/facade/lang.d.ts(4,17): error TS2304: Cannotfind name ’Map’.node_modules/@angular/compiler/src/facade/lang.d.ts(5,17): error TS2304: Cannotfind name ’Set’.node_modules/@angular/compiler/src/facade/lang.d.ts(71,59): error TS2304: Cannot find name ’Map’.node_modules/@angular/compiler/src/offline_compiler.d.ts(32,70): error TS2304: Cannot find name ’Promise’.node_modules/@angular/compiler/src/offline_compiler.d.ts(34,85): error TS2304: Cannot find name ’Promise’.node_modules/@angular/compiler/src/output/output_ast.d.ts(417,63): error TS2304: Cannot find name ’Set’.node_modules/@angular/compiler/src/runtime_compiler.d.ts(28,49): error TS2304: Cannot find name ’Promise’.node_modules/@angular/compiler/src/template_parser.d.ts(37,12): error TS2304: Cannot find name ’Set’.node_modules/@angular/compiler/src/view_compiler/compile_view.d.ts(43,16): error TS2304: Cannot find name ’Map’.node_modules/@angular/compiler/src/view_compiler/compile_view.d.ts(45,13): error TS2304: Cannot find name ’Map’.node_modules/@angular/compiler/src/view_compiler/compile_view.d.ts(52,17): error TS2304: Cannot find name ’Map’.node_modules/@angular/compiler/src/xhr.d.ts(6,23): error TS2304: Cannot find name ’Promise’.node_modules/@angular/compiler/testing/test_component_builder.d.ts(77,19): error TS2304: Cannot find name ’Promise’.node_modules/@angular/compiler/testing/test_component_builder.d.ts(137,43): error TS2304: Cannot find name ’Promise’.node_modules/@angular/compiler/testing/xhr_mock.d.ts(10,23): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/application_ref.d.ts(45,88): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/application_ref.d.ts(101,42): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/application_ref.d.ts(160,33): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,15): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(26,16): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/di/reflective_provider.d.ts(106,123): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/di/reflective_provider.d.ts(106,165): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/async.d.ts(27,33): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/facade/async.d.ts(28,45): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/facade/collection.d.ts(1,25): error TS2304: Cannot find name ’MapConstructor’.node_modules/@angular/core/src/facade/collection.d.ts(2,25): error TS2304: Cannot find name ’SetConstructor’.node_modules/@angular/core/src/facade/collection.d.ts(4,27): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/collection.d.ts(4,39): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/collection.d.ts(7,9): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/collection.d.ts(8,30): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/collection.d.ts(11,43): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/collection.d.ts(12,27): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/collection.d.ts(14,23): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/collection.d.ts(15,25): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/collection.d.ts(100,41): error TS2304: Cannot find name ’Set’.node_modules/@angular/core/src/facade/collection.d.ts(101,22): error TS2304: Cannot find name ’Set’.node_modules/@angular/core/src/facade/collection.d.ts(102,25): error TS2304: Cannot find name ’Set’.node_modules/@angular/core/src/facade/lang.d.ts(4,17): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/lang.d.ts(5,17): error TS2304: Cannot find name ’Set’.node_modules/@angular/core/src/facade/lang.d.ts(71,59): error TS2304: Cannot find name ’Map’.node_modules/@angular/core/src/facade/promise.d.ts(2,14): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/facade/promise.d.ts(8,32): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/facade/promise.d.ts(9,38): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/facade/promise.d.ts(10,35): error TS2304: Cannotfind name ’Promise’.node_modules/@angular/core/src/facade/promise.d.ts(10,93): error TS2304: Cannotfind name ’Promise’.node_modules/@angular/core/src/facade/promise.d.ts(11,34): error TS2304: Cannotfind name ’Promise’.node_modules/@angular/core/src/facade/promise.d.ts(11,50): error TS2304: Cannotfind name ’Promise’.node_modules/@angular/core/src/facade/promise.d.ts(12,32): error TS2304: Cannotfind name ’Promise’.node_modules/@angular/core/src/facade/promise.d.ts(12,149): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/facade/promise.d.ts(13,43): error TS2304: Cannotfind name ’Promise’.node_modules/@angular/core/src/linker/component_resolver.d.ts(9,58): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/linker/component_resolver.d.ts(13,49): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/linker/dynamic_component_loader.d.ts(61,148): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/linker/dynamic_component_loader.d.ts(102,144): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/linker/dynamic_component_loader.d.ts(107,139): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/linker/dynamic_component_loader.d.ts(108,135): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/linker/systemjs_component_resolver.d.ts(11,53): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/src/linker/systemjs_component_resolver.d.ts(19,53): error TS2304: Cannot find name ’Promise’.node_modules/@angular/core/testing/mock_application_ref.d.ts(12,33): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser-dynamic/index.d.ts(72,90): error TS2304:Cannot find name ’Promise’.node_modules/@angular/platform-browser-dynamic/index.d.ts(73,99): error TS2304:Cannot find name ’Promise’.node_modules/@angular/platform-browser-dynamic/index.d.ts(74,99): error TS2304:Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/dom/dom_adapter.d.ts(89,42): error TS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/dom/dom_renderer.d.ts(10,37): error TS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/async.d.ts(27,33): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/async.d.ts(28,45): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(1,25): error TS2304: Cannot find name ’MapConstructor’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(2,25): error TS2304: Cannot find name ’SetConstructor’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(4,27): error TS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(4,39): error TS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(7,9): error TS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(8,30): error TS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(11,43): errorTS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(12,27): errorTS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(14,23): errorTS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(15,25): errorTS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(100,41): error TS2304: Cannot find name ’Set’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(101,22): error TS2304: Cannot find name ’Set’.node_modules/@angular/platform-browser/src/facade/collection.d.ts(102,25): error TS2304: Cannot find name ’Set’.node_modules/@angular/platform-browser/src/facade/lang.d.ts(4,17): error TS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/lang.d.ts(5,17): error TS2304: Cannot find name ’Set’.node_modules/@angular/platform-browser/src/facade/lang.d.ts(71,59): error TS2304: Cannot find name ’Map’.node_modules/@angular/platform-browser/src/facade/promise.d.ts(2,14): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/promise.d.ts(8,32): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/promise.d.ts(9,38): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/promise.d.ts(10,35): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/promise.d.ts(10,93): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/promise.d.ts(11,34): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/promise.d.ts(11,50): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/promise.d.ts(12,32): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/promise.d.ts(12,149): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/facade/promise.d.ts(13,43): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/web_workers/shared/client_message_broker.d.ts(25,65): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/web_workers/shared/client_message_broker.d.ts(33,56): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/web_workers/shared/service_message_broker.d.ts(33,84): error TS2304: Cannot find name ’Promise’.node_modules/@angular/platform-browser/src/web_workers/worker/location_providers.d.ts(14,86): error TS2304: Cannot find name ’Promise’.node_modules/rxjs/Observable.d.ts(10,66): error TS2304: Cannot find name ’Promise’.node_modules/rxjs/Observable.d.ts(66,60): error TS2304: Cannot find name ’Promise’.node_modules/rxjs/Observable.d.ts(66,70): error TS2304: Cannot find name ’Promise’.app/app.component.spec.ts(32,40): error TS7006: Parameter ’fixture’ implicitly has an ’any’ type.app/app.component.spec.ts(40,42): error TS7006: Parameter ’fixture’ implicitly has an ’any’ type.app/app.component.spec.ts(43,43): error TS7006: Parameter ’el’ implicitly has an ’any’ type.npm ERR! Windows_NT 6.1.7601npm ERR! argv 'C:Program Filesnodejsnode.exe' 'C:Userslwx344455AppDataRoamingnpmnode_modulesnpmbinnpm-cli.js' 'start'npm ERR! node v6.2.1npm ERR! npm v3.9.5npm ERR! code ELIFECYCLEnpm ERR! angular2-quickstart@1.0.0 start: `tsc && concurrently 'tsc -w' 'lite-server' `npm ERR! Exit status 2npm ERR!npm ERR! Failed at the angular2-quickstart@1.0.0 start script ’tsc && concurrently 'tsc -w' 'lite-server' ’.npm ERR! Make sure you have the latest version of node.js and npm installed.npm ERR! If you do, this is most likely a problem with the angular2-quickstart package,npm ERR! not with npm itself.npm ERR! Tell the author that this fails on your system:npm ERR! tsc && concurrently 'tsc -w' 'lite-server'npm ERR! You can get information on how to open an issue for this project with:npm ERR! npm bugs angular2-quickstartnpm ERR! Or if that isn’t available, you can get their info via:npm ERR! npm owner ls angular2-quickstartnpm ERR! There is likely additional logging output above.npm ERR! Please include the following file with any support request:npm ERR! C:Userslwx344455Desktopnghello2ng2npm-debug.logC:Userslwx344455Desktopnghello2ng2>npm install> angular2-quickstart@1.0.0 postinstall C:Userslwx344455Desktopnghello2ng2> typings installtypings ERR! message Unable to connect to 'https://api.typings.org/entries/dt/jasmine/tags/2.2.0%2B20160505161446'typings ERR! caused by connect ETIMEDOUT 104.24.113.177:443typings ERR! cwd C:Userslwx344455Desktopnghello2ng2typings ERR! system Windows_NT 6.1.7601typings ERR! command 'C:Program Filesnodejsnode.exe' 'C:Userslwx344455Desktopnghello2ng2node_modulestypingsdistbin.js' 'install'typings ERR! node -v v6.2.1typings ERR! typings -v 1.2.0typings ERR! code EUNAVAILABLEtypings ERR! If you need help, you may report this error at:typings ERR! <https://github.com/typings/typings/issues>npm WARN optional Skipping failed optional dependency /chokidar/fsevents:npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.12npm WARN optional Skipping failed optional dependency /browser-sync/chokidar/fsevents:npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.12npm WARN angular2-in-memory-web-api@0.0.11 requires a peer of @angular/core@2.0.0-rc.1 but none was installed.npm WARN angular2-in-memory-web-api@0.0.11 requires a peer of @angular/http@2.0.0-rc.1 but none was installed.npm ERR! Windows_NT 6.1.7601npm ERR! argv 'C:Program Filesnodejsnode.exe' 'C:Userslwx344455AppDataRoamingnpmnode_modulesnpmbinnpm-cli.js' 'install'npm ERR! node v6.2.1npm ERR! npm v3.9.5npm ERR! code ELIFECYCLEnpm ERR! angular2-quickstart@1.0.0 postinstall: `typings install`npm ERR! Exit status 1npm ERR!npm ERR! Failed at the angular2-quickstart@1.0.0 postinstall script ’typings install’.npm ERR! Make sure you have the latest version of node.js and npm installed.npm ERR! If you do, this is most likely a problem with the angular2-quickstart package,npm ERR! not with npm itself.npm ERR! Tell the author that this fails on your system:npm ERR! typings installnpm ERR! You can get information on how to open an issue for this project with:npm ERR! npm bugs angular2-quickstartnpm ERR! Or if that isn’t available, you can get their info via:npm ERR! npm owner ls angular2-quickstartnpm ERR! There is likely additional logging output above.npm ERR! Please include the following file with any support request:npm ERR! C:Userslwx344455Desktopnghello2ng2npm-debug.log

//Package.json

{ 'name': 'angular2-quickstart', 'version': '1.0.0', 'scripts': { 'postinstall': 'npm run typings install', 'tsc': 'tsc', 'tsc:w': 'tsc -w', 'lite': 'lite-server', 'start': 'concurrent 'npm run tsc:w' 'npm run lite' ', 'typings' : 'typings' }, 'license': 'ISC', 'dependencies': { 'angular2': '2.0.0-beta.6', 'systemjs': '0.19.20', 'es6-promise': '^3.0.2', 'es6-shim': '^0.33.3', 'reflect-metadata': '0.1.2', 'rxjs': '5.0.0-beta.0', 'zone.js': '0.5.14' }, 'devDependencies': { 'concurrently': '^1.0.0', 'lite-server': '^2.0.1', 'typescript': '^1.7.5', 'typings':'^0.6.8' }}

问题解答

回答1:

是时候看我的文档了angular2初入眼帘之-搭个环境。

官网那个太麻烦,我这个能用

相关文章: