Browserify Cannot find package.json module

When I try to start the browser, I get the following error:

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'

What does the test folder look like

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

What does my .json package look like

{
    "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"
    }
}

Any ideas?

+3
source share

All Articles