我最近将Angular CLI升级到7.2.1。升级后,我意识到在使用
创建新项目时ng新的hello-ng-world
命令失败,并出现以下错误。
npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! Unexpected end of JSON input while parsing near '...ource-map":"0.1.x"},"'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\XXX\AppData\Roaming\npm-cache\_logs\2019-01-15T04_01_29_782Z-debug.log
Package install failed, see above.
我检查了日志文件,发现以下几行
2298 silly fetchPackageMetaData error for mini-css-extract-plugin@0.4.4 Unexpected end of JSON input while parsing near '...","webpack-cli":"^2.0'
....
2316 silly fetchPackageMetaData error for portfinder@1.0.17 Unexpected end of JSON input while parsing near '...82V3Kq5OEdhCZQ8nOUUQ/'
2352 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...ource-map":"0.1.x"},"'
2352 verbose stack at JSON.parse (<anonymous>)
2352 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17)
无法继续创建项目。请建议可以做什么。
修改1: Ng版本详细信息(ng --version)
Angular CLI: 7.2.1
Node: 8.11.1
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.12.1
@angular-devkit/core 7.2.1
@angular-devkit/schematics 7.2.1
@schematics/angular 7.2.1
@schematics/update 0.12.1
rxjs 6.3.3
typescript 3.2.2
答案 0 :(得分:0)
我不得不强制清除缓存以使其正常运行。我使用了以下命令。
import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
wsgi = imp.load_source('wsgi', 'aida_ganaderia_luz_y_sombra/wsgi.py')
application = wsgi.application