无法在我的nodejs项目目录中以及全局安装mysql模块

无法在我的nodejs项目目录中以及全局安装mysql模块,mysql,node.js,npm,Mysql,Node.js,Npm,我想要的就是这里!但它向我展示了这一点 F:\nodeDemo\nodeMysql>npm install mysql npm ERR! Unexpected end of JSON input while parsing near '...":"mysql","version":"' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Nisith Saha\AppData\Roaming

我想要的就是这里!但它向我展示了这一点

F:\nodeDemo\nodeMysql>npm install mysql
npm ERR! Unexpected end of JSON input while parsing near '...":"mysql","version":"'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Nisith Saha\AppData\Roaming\npm-cache\_logs\2019-11-12T21_29_01_184Z-debug.log
错误屏幕截图

错误日志文本文件(debug..file)显示以下内容。有什么建议/解决方案吗?这里怎么了

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'mysql'
1 verbose cli ]
2 info using npm@6.12.0
3 info using node@v12.13.0
4 verbose npm-session 98291420349cc4f5
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/mysql 858ms (from cache)
8 silly fetchPackageMetaData error for mysql@latest Unexpected end of JSON input while parsing near '...":"mysql","version":"'
9 timing stage:rollbackFailedOptional Completed in 1ms
10 timing stage:runTopLevelLifecycles Completed in 1047ms
11 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...":"mysql","version":"'
11 verbose stack     at JSON.parse (<anonymous>)
11 verbose stack     at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
11 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
11 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
12 verbose cwd F:\nodeDemo\nodeMysql
13 verbose Windows_NT 10.0.17763
14 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "mysql"
15 verbose node v12.13.0
16 verbose npm  v6.12.0
17 error Unexpected end of JSON input while parsing near '...":"mysql","version":"'
18 verbose exit [ 1, true ]
0信息如果它以ok结尾,它就工作了
1详细cli[
1详细cli'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli'C:\\Program Files\\nodejs\\node\u modules\\npm\\bin\\npm cli.js',
1详细cli“安装”,
1详细cli“mysql”
1详细cli]
2信息使用npm@6.12.0
3信息使用node@v12.13.0
4详细npm会议98291420349cc4f5
5.安装loadCurrentTree
6.安装readLocalPackageData
7 http获取304https://registry.npmjs.org/mysql 858ms(来自缓存)
8.1的PackageMetadata错误mysql@latest在“…”:“mysql”,“版本”:“附近进行分析时,JSON输入意外结束
9定时阶段:1毫秒内完成回卷可选
10计时阶段:在1047ms内完成RunTopLevel生命周期
11详细堆栈语法错误:在“…”:“mysql”,“version:”附近解析时JSON输入意外结束
11 JSON.parse()处的详细堆栈
11 parseJson的详细堆栈(C:\Program Files\nodejs\node\u modules\npm\node\u modules\json parse better errors\index.js:7:17)
11位于C:\Program Files\nodejs\node\u modules\npm\node\u modules\node fetch npm\src\body.js的详细堆栈:96:50
11 processTicksAndRejections的详细堆栈(internal/process/task_queues.js:93:5)
12详细cwd F:\nodededemo\nodeMysql
13详细窗口\u NT 10.0.17763
14详细argv“C:\\Program Files\\nodejs\\node.exe”“C:\\Program Files\\nodejs\\node\U模块\\npm\\bin\\npm cli.js”“安装”“mysql”
15详细节点v12.13.0
16详细的npm v6.12.0
17在“…”:“mysql”,“version:”附近解析时,JSON输入意外结束时出错
18详细退出[1,true]

这个代码对我有用->

npm WARN using --force I sure hope you know what you are doing.

F:\nodeDemo>npm cache verify
Cache verified and compressed (~\AppData\Roaming\npm-cache\_cacache):
Content verified: 0 (0 bytes)
Index entries: 0
Finished in 0.045s

F:\nodeDemo>npm install mysql -g
+ mysql@2.17.1
added 11 packages from 15 contributors in 14.555s

抱歉,我刚开始漏掉了一行,即`>npm缓存清除--force`