我正在尝试为angular2设置编码环境。我试图在npm install
文件上运行package.json
。如下所示,它运行不正常,下面的代码是我在运行npm install
后收到的代码。我知道错误404意味着找不到年龄,但我仍然不知道如何解决问题。如果有人可以向我解释如何解决所有这些错误,那将非常有帮助。我也愿意接受这个问题的替代解决方案。如果它有助于我仍然在Windows XP上(我不知道这是否会改变解决方案的任何内容)。
"C:\Program Files\JetBrains\WebStorm 2016.3.3\bin\runnerw.exe"
"C:\Program Files\nodejs\node.exe" "C:\Program
Files\nodejs\node_modules\npm\bin\npm-cli.js" install
npm WARN package.json angular2-seed@1.0.0 scripts['server'] should
probably be scripts['start'].
npm http GET https://registry.npmjs.org/angular2-in-memory-web-api
npm http GET https://registry.npmjs.org/bootstrap
(...)
npm http GET https://registry.npmjs.org/typescript
npm http 304 https://registry.npmjs.org/rxjs
npm http 304 https://registry.npmjs.org/angular2-in-memory-web-api
npm http 304 https://registry.npmjs.org/reflect-metadata
npm http 304 https://registry.npmjs.org/bootstrap
npm http 304 https://registry.npmjs.org/angular2-router-loader
npm http 304 https://registry.npmjs.org/angular2-template-loader
npm http 304 https://registry.npmjs.org/zone.js
npm http 304 https://registry.npmjs.org/core-js
npm http 304 https://registry.npmjs.org/css-loader
npm http 304 https://registry.npmjs.org/raw-loader
npm http 304 https://registry.npmjs.org/to-string-loader
npm http 304 https://registry.npmjs.org/awesome-typescript-loader
npm http 304 https://registry.npmjs.org/webpack
npm http 304 https://registry.npmjs.org/ie-shim
npm http 404 https://registry.npmjs.org/angular/common
npm http 404 https://registry.npmjs.org/angular/compiler
npm http 404 https://registry.npmjs.org/angular/forms
npm http 404 https://registry.npmjs.org/angular/compiler-cli
npm http 404 https://registry.npmjs.org/angular/core
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'angular/common' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'angular2-seed'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Windows_NT 5.1.2600
npm ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program
Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Documents and Settings\Administrator\My
Documents\Programming\angular2-seed-master\angular2-seed-master
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code E404
npm http 304 https://registry.npmjs.org/webpack-merge
npm http 404 https://registry.npmjs.org/angular/platform-server
npm http 404 https://registry.npmjs.org/angular/http
npm http 404 https://registry.npmjs.org/angular/platform-browser
npm http 404 https://registry.npmjs.org/angular/platform-browser-dynamic
npm http 404 https://registry.npmjs.org/angular/router
npm http 304 https://registry.npmjs.org/webpack-dev-server
npm http 304 https://registry.npmjs.org/typescript
npm http 404 https://registry.npmjs.org/types/node
npm http 404 https://registry.npmjs.org/angular/upgrade
Process finished with exit code 1
答案 0 :(得分:1)
不再提供您正在使用的Angular 2的版本。您应该使用Angular CLI启动一个新的Angular2项目。
您需要使用命令npm install -g @angular/cli
安装它,然后使用命令ng new your-project-name
启动新项目。
答案 1 :(得分:0)
首先,在控制台中输入ng init
。它将安装npm install
进程所需的一些重要文件,例如package.json
。然后,使用npm install
命令。