node keystone无法找到模块'./browserify'

时间:2017-07-23 03:51:09

标签: node.js keystonejs

在我的项目文件夹中执行npm install之前,一切正常。

我正在运行macOS Sierra 10.12.5,node.js v8.2.1,npm v5.3.0

我尝试过:

  • 卸载节点/ npm并重新安装
  • npm install -g browserify
  • npm insatll browserify on my project folder
  • 重新安装KeystoneJS生成器

我的package.json

   {
  "name": "site-name",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "keystone": "4.0.0-beta.5",
    "lodash": "^4.13.1",
    "consolidate": "0.14.5",
    "nunjucks": "3.0.0",
    "node-sass": "4.5.0",
    "node-sass-middleware": "0.11.0",
    "dotenv": "4.0.0",
    "async": "2.1.4",
    "express-sslify": "1.2.0"
  },
  "devDependencies": {
    "eslint": "3.15.0",
    "eslint-config-keystone": "3.0.0",
    "eslint-plugin-react": "^5.1.1"
  },
  "scripts": {
    "lint": "eslint .",
    "start": "node keystone.js"
  }
}

这是终端

中的输出
node keystone
module.js:487
    throw err;
    ^

Error: Cannot find module './browserify'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/Tyler/Desktop/Forge_Fitness_Site/models/node_modules/sha.js/bin.js:3:18)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at /Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:42:23
    at Array.forEach (native)
    at importer (/Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:32:26)
    at /Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:36:22
    at Array.forEach (native)
    at importer (/Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:32:26)
    at /Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:36:22
    at Array.forEach (native)
    at importer (/Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/lib/core/importer.js:32:26)
    at Keystone.import (/Users/Tyler/Desktop/Forge_Fitness_Site/node_modules/keystone/index.js:176:42)
    at Object.<anonymous> (/Users/Tyler/Desktop/Forge_Fitness_Site/keystone.js:41:16)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

1 个答案:

答案 0 :(得分:0)

好吧,我修复了这个问题,不确定它是怎么发生的,但不知怎的,我最终在项目目录中找到了两个node_modules文件夹。删除第二个修复了我的问题。