Browserify无法找到模块package.json

时间:2014-02-24 19:50:16

标签: browserify

当我尝试运行browserify时,出现以下错误:

Trace
    at /test/node_modules/browserify-shim/lib/resolve-shims.js:216:17
    at /test/node_modules/browserify-shim/node_modules/find-parent-dir/index.js:16:26
    at Object.cb [as oncomplete] (fs.js:168:19)
Error: Cannot find module 'package.json'

我的测试文件夹是什么样的

/test
 ->/node_modules
 ->index.js
 ->jquery.js 
 ->package.json

我的package.json是什么样的

{
    "name": "test",
    "version": "1.0.0",
    "description": "",
    "main": "./index.js",
    "browser": {
        "jquery": "./jquery.js"
    },
    "browserify": {
        "transform": [
            "browserify-shim"
        ]
    },
    "browserify-shim": {
        "jquery": "$"
    },
    "repository": "",
    "author": "",
    "devDependencies": {
        "browserify": "^3.30.2",
        "browserify-shim": "^3.2.2"
    }
}

有什么想法吗?

0 个答案:

没有答案
相关问题