创建一个新的ionic3项目时出错

时间:2017-09-28 14:50:21

标签: ionic-framework ionic3

创建新的ionic3项目时出错

我正在尝试使用Ionic在Windows 10中创建一个新项目,并完全安装所有依赖项和模块。

但是当我创建一个应用程序时,它会抛出以下错误:

PS D:\WorkSpace\WebStorm> ionic start timelove tabs
√ Creating directory .\timelove - done!
[INFO] Fetching app base (https://github.com/ionic-team/ionic2-app-base/archive/master.tar.gz)
√ Downloading - done!
[INFO] Fetching starter template tabs (https://github.com/ionic-team/ionic2-starter-tabs/archive/master.tar.gz)
√ Downloading - done!
√ Updating package.json with app details - done!
√ Creating configuration file ionic.config.json - done!
[INFO] Installing dependencies may take several minutes!
> npm install
× Running command - failed!
[ERROR] An error occurred while running npm install (exit code 1):


        npm WARN deprecated babili@0.1.2: babili has been renamed to babel-minify. Please update to babel-minify
        npm WARN deprecated babel-preset-babili@0.1.4: babili has been renamed to babel-minify. Please update to
        babel-preset-minify
        npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys
        npm ERR! Unexpected end of input at 1:21492
        npm ERR! ctories":{},"dist":{"shasum":"65c909b778715753797129b9ea39bca6a248d6f
        npm ERR!                                                                      ^

        npm ERR! A complete log of this run can be found in:
        npm ERR!     C:\Users\T\AppData\Roaming\npm-cache\_logs\2017-09-28T14_31_33_347Z-debug.log

此次运行的完整日志:

1532 verbose stack SyntaxError: Unexpected end of input at 1:21492
1532 verbose stack ctories":{},"dist":{"shasum":"65c909b778715753797129b9ea39bca6a248d6f
1532 verbose stack                                                                      ^
1532 verbose stack     at Object.parseJSON (C:\ASoft\Develop\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-helpfulerror\node_modules\jju\lib\parse.js:745:13)
1532 verbose stack     at parse (C:\ASoft\Develop\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-helpfulerror\index.js:10:13)
1532 verbose stack     at consumeBody.call.then.buffer (C:\ASoft\Develop\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
1532 verbose stack     at <anonymous>
1532 verbose stack     at process._tickCallback (internal/process/next_tick.js:188:7)
1533 verbose cwd D:\WorkSpace\WebStorm\timelove
1534 verbose Windows_NT 10.0.15063
1535 verbose argv "C:\\ASoft\\Develop\\nodejs\\node.exe" "C:\\ASoft\\Develop\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
1536 verbose node v8.4.0
1537 verbose npm  v5.3.0
1538 error Unexpected end of input at 1:21492
1538 error ctories":{},"dist":{"shasum":"65c909b778715753797129b9ea39bca6a248d6f
1538 error                                                                      ^
1539 verbose exit [ 1, true ]

我无法弄清楚发生了什么。有什么建议吗?

cli packages: (C:\Users\T\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.10.2
    ionic (Ionic CLI) : 3.10.3

System:

    Node : v8.4.0
    npm  : 5.3.0
    OS   : Windows 10

1 个答案:

答案 0 :(得分:-1)

转到C:\Users\T\AppData\Roaming并删除文件夹npm-cache,然后在终端中输入命令:

npm install