在MVC 5中还原程序包而不为angular 4创建node_modules

时间:2018-10-29 07:29:43

标签: node.js angular npm npm-install

Node Version - v8.12.0
NPM version - 6.4.1
Angular - 4.0
MVC - 4.6.1
Visual Studio - 2015

Package.json

{
  "name": "Angular4",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "@angular/common": "^4.0.1",
    "@angular/compiler": "^4.0.1",
    "@angular/core": "^4.0.1",
    "@angular/forms": "^4.0.1",
    "@angular/http": "^4.0.1",
    "@angular/platform-browser": "^4.0.1",
    "@angular/platform-browser-dynamic": "^4.0.1",
    "@angular/router": "^4.0.1",
    "core-js": "^2.4.1",
    "rxjs": "^5.3.0",
    "systemjs": "^0.20.12",
    "zone.js": "^0.8.5"
  },
  "devDependencies": {
    "@types/node": "^7.0.12",
    "http-server": "^0.9.0",
    "typescript": "^2.2.2"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

当我尝试恢复上述package.json的软件包时;我收到以下错误:

====Executing command 'npm install'====


npm WARN package.json Angular4@1.0.0 No description
npm WARN package.json Angular4@1.0.0 No repository field.
npm WARN package.json Angular4@1.0.0 No README data
npm http GET https://registry.npmjs.org/http-server
npm http GET https://registry.npmjs.org/core-js
npm http GET https://registry.npmjs.org/systemjs
npm http GET https://registry.npmjs.org/zone.js
npm http GET https://registry.npmjs.org/angular/compiler
npm http GET https://registry.npmjs.org/rxjs
npm http GET https://registry.npmjs.org/types/node
npm http GET https://registry.npmjs.org/angular/platform-browser
npm http GET https://registry.npmjs.org/angular/router
npm http GET https://registry.npmjs.org/angular/core
npm http GET https://registry.npmjs.org/angular/platform-browser-dynamic
npm http GET https://registry.npmjs.org/angular/http
npm http GET https://registry.npmjs.org/angular/forms
npm http GET https://registry.npmjs.org/angular/common
npm http 304 https://registry.npmjs.org/core-js
npm http 304 https://registry.npmjs.org/rxjs
npm http 304 https://registry.npmjs.org/http-server
npm http 304 https://registry.npmjs.org/zone.js
npm http 304 https://registry.npmjs.org/systemjs
npm http GET https://registry.npmjs.org/typescript
npm http 405 https://registry.npmjs.org/angular/router
npm ERR! Error: Method Not Allowed
npm ERR!     at errorResponse (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\npm\node_modules\npm\lib\cache.js:753:14)
npm ERR!     at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\npm\node_modules\npm\lib\cache.js:773:12
npm ERR!     at saved (C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\npm\node_modules\npm-registry-client\lib\get.js:148:7)
npm ERR!     at C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\npm\node_modules\graceful-fs\polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node" "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd c:\users\documents\visual studio 2015\Projects
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.9
npm ERR! code E405
npm http 405 https://registry.npmjs.org/angular/platform-browser-dynamic
npm http 405 https://registry.npmjs.org/angular/compiler
npm http 405 https://registry.npmjs.org/angular/platform-browser
npm http 405 https://registry.npmjs.org/types/node
npm http 304 https://registry.npmjs.org/typescript
npm http 405 https://registry.npmjs.org/angular/core
npm http 405 https://registry.npmjs.org/angular/common
npm http 405 https://registry.npmjs.org/angular/http
npm http 405 https://registry.npmjs.org/angular/forms
npm

====npm command completed with exit code 1====

如果我尝试使用命令提示符(npm install)可以工作,但是每次当我更改 app.component.ts 中的代码时,我都需要停止并启动应用程序以查看代码更改。我什至禁用了Chrome缓存。

有人可以帮我吗?

0 个答案:

没有答案