sqlite3找不到child_process和fs

时间:2017-12-04 11:35:33

标签: node.js sqlite next.js

我有一个next.js应用程序设置,我正在尝试集成sqlite3。我这样导入它:

const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('database.db');

但是当我运行我的节点快速服务器时,我得到以下内容:

These dependencies were not found:

* child_process in ./node_modules/node-gyp/lib/build.js, ./node_modules/node-gyp/lib/node-gyp.js and 7 others
* fs in ./node_modules/fs.realpath/old.js, ./node_modules/fs.realpath/index.js and 35 others

To install them, you can run: npm install --save child_process fs

我已经运行了npm install,但它仍然要求给我这个错误。

以下是package.json中的依赖项:

"dependencies": {
    "autoprefixer": "7.1.5",
    "aws-sdk": "^2.162.0",
    "axios": "0.15.3",
    "babel-cli": "^6.26.0",
    "babel-plugin-inline-react-svg": "^0.4.0",
    "babel-plugin-module-resolver": "^2.7.1",
    "babel-plugin-wrap-in-js": "^1.1.0",
    "babel-preset-es2015": "^6.24.1",
    "child_process": "^1.0.2",
    "cookie-parser": "^1.4.3",
    "express": "^4.14.0",
    "fs": "0.0.1-security",
    "glob": "^7.1.2",
    "jsonwebtoken": "^8.1.0",
    "net": "^1.0.2",
    "next": "latest",
    "njwt": "^0.4.0",
    "node-sass": "^4.4.0",
    "normalize.css": "^7.0.0",
    "postcss-easy-import": "^3.0.0",
    "postcss-loader": "^2.0.7",
    "prop-types": "^15.6.0",
    "raw-loader": "^0.5.1",
    "react": "^16.0.0",
    "react-dom": "^16.0.0",
    "sass-loader": "^6.0.6",
    "semantic-ui-react": "^0.73.0",
    "sqlite3": "^3.1.13",
    "superagent": "^3.4.0",
    "tls": "0.0.1"
  },

0 个答案:

没有答案