在Runnin NPM安装mysqljs / mysql时如何解决以下错误?

时间:2019-06-19 14:42:39

标签: javascript mysql node.js

我想将Mysql安装到我的node.js项目中。我尝试使用这些命令进行安装

npm install mysqljs/mysql
npm install mysql

但是我遇到了以下错误

npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\cbshr\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\cbshr\package.json'
npm WARN cbshr No description
npm WARN cbshr No repository field.
npm WARN cbshr No README data
npm WARN cbshr No license field.


npm install mysqljs/mysql
npm install mysql


npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\cbshr\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\cbshr\package.json'
npm WARN cbshr No description
npm WARN cbshr No repository field.
npm WARN cbshr No README data
npm WARN cbshr No license field.

1 个答案:

答案 0 :(得分:0)

您需要从包含项目的文件夹中运行终端。根据该消息,终端正在C:\Users\cbshr\上运行。

在Windows中,右击该文件夹,然后选择“在此处打开命令窗口”,或使用cd命令导航到包含您的项目的文件夹。