我的react项目提醒我当npm在本地运行时找不到模块'eslint-plugin-vue'

时间:2019-04-02 10:32:10

标签: eslint

我运行我同事的项目,该项目正在响应,当我在本地运行npm时,终端告诉我"Module build failed: Error: Failed to load plugin vue: Cannot find module 'eslint-plugin-vue'"

我的npm全球node_modules没有陪同

the project .eslintrc:
"extends": [
        "airbnb-base",
        "eslint:recommended",
        "plugin:react/recommended"
    ],
    "parser": "babel-eslint",
    "env": {
        "browser": true
    },
    "plugins": [
        "react"
    ],
...

1 个答案:

答案 0 :(得分:0)

debug.log:

    0 info it worked if it ends with ok
    1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'eslint' ]
    2 info using npm@6.5.0
    3 info using node@v8.9.4
    4 verbose run-script [ 'preeslint', 'eslint', 'posteslint' ]
    5 info lifecycle shops@0.0.1~preeslint: shops@0.0.1
    6 info lifecycle shops@0.0.1~eslint: shops@0.0.1
    7 verbose lifecycle shops@0.0.1~eslint: unsafe-perm in lifecycle true
    8 verbose lifecycle shops@0.0.1~eslint: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/wenbowan/Desktop/gitw/reco-fe-merchant-members/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
    9 verbose lifecycle shops@0.0.1~eslint: CWD: /Users/wenbowan/Desktop/gitw/reco-fe-merchant-members
    10 silly lifecycle shops@0.0.1~eslint: Args: [ '-c', 'eslint --ext .js, src' ]
    11 silly lifecycle shops@0.0.1~eslint: Returned: code: 1  signal: null
    12 info lifecycle shops@0.0.1~eslint: Failed to exec eslint script
    13 verbose stack Error: shops@0.0.1 eslint: `eslint --ext .js, src`
    13 verbose stack Exit status 1
    13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
    13 verbose stack     at emitTwo (events.js:126:13)
    13 verbose stack     at EventEmitter.emit (events.js:214:7)
    13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
    13 verbose stack     at emitTwo (events.js:126:13)
    13 verbose stack     at ChildProcess.emit (events.js:214:7)
    13 verbose stack     at maybeClose (internal/child_process.js:925:16)
    13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
    14 verbose pkgid shops@0.0.1
    15 verbose cwd /Users/wenbowan/Desktop/gitw/reco-fe-merchant-members
    16 verbose Darwin 18.2.0
    17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "eslint"
    18 verbose node v8.9.4
    19 verbose npm  v6.5.0
    20 error code ELIFECYCLE
    21 error errno 1
    22 error shops@0.0.1 eslint: `eslint --ext .js, src`
    22 error Exit status 1
    23 error Failed at the shops@0.0.1 eslint script.
    23 error This is probably not a problem with npm. There is likely additional logging output above.
    24 verbose exit [ 1, true ]