2017-05-25 72 views
0

模塊 'eslint-配置-的Airbnb /基地' 當我運行stencil bundle我看到以下內容:上找不到的Bigcommerce '模板捆綁'

➜ cornerstone git:(master) ✗ stencil bundle 
    Validating theme... 
    Running ESLint... 
    /Users/xxx/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/eslint/lib/config/config-file.js:402 
       throw e; 
      ^

    Error: Cannot find module 'eslint-config-airbnb/base' 
    Referenced from: /Users/xxx/bigcommerce/cornerstone/.eslintrc 
     at Object.ModuleResolver.resolve (/Users/xxx/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/eslint/lib/util/module-resolver.js:75:19) 
     at resolve (/Users/xxx/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/eslint/lib/config/config-file.js:479:33) 
     at load (/Users/xxx/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/eslint/lib/config/config-file.js:496:24) 
     at /Users/xxx/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/eslint/lib/config/config-file.js:392:36 
     at Array.reduceRight (native) 
     at applyExtends (/Users/xxx/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/eslint/lib/config/config-file.js:363:28) 
     at Object.load (/Users/xxx/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/eslint/lib/config/config-file.js:530:22) 
     at loadConfig (/Users/xxx/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/eslint/lib/config.js:64:33) 
     at getLocalConfig (/Users/xxx/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/eslint/lib/config.js:126:23) 
     at Config.getConfig (/Users/xxx/.nvm/versions/node/v4.4.0/lib/node_modules/@bigcommerce/stencil-cli/node_modules/eslint/lib/config.js:227:22) 

當我最初運行npm install我看到了這一點:

➜ cornerstone git:(master) npm install 
    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
    npm WARN peerDependencies The peer dependency [email protected]>=1.9 included from karma-phantomjs-launcher will no 
    npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
    npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
    npm WARN peerDependencies The peer dependency [email protected]^2.4.0 included from eslint-config-airbnb will no 
    npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
    npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
    npm WARN peerDependencies The peer dependency [email protected]^4.2.3 included from eslint-config-airbnb will no 
    npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
    npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. 
    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue 
    npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to [email protected]^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree. 

按照文檔我試圖運行eslint-config-airbnb和運行此命令:

npm install --save-dev eslint-config-airbnb [email protected]^3.19.0 [email protected]^5.0.1 [email protected]^2.2.0 [email protected]^7.0.1 

基於此:

➜ cornerstone git:(master) ✗ npm info "[email protected]" peerDependencies 

    { eslint: '^3.19.0', 
    'eslint-plugin-jsx-a11y': '^5.0.1', 
    'eslint-plugin-import': '^2.2.0', 
    'eslint-plugin-react': '^7.0.1' } 
+0

重新安裝最新github master的基石。造成這種情況的變化已經恢復。 – Alyss

+0

我只是這樣做,仍然有一個錯誤。最新的npm install顯示了這個:'npm WARN [email protected]需要[email protected]^4.2.3的同行,但沒有安裝。 npm WARN [email protected]需要phantomjs-prebuilt @> = 1.9的同行,但沒有人安裝過。「 – Abram

+0

@Alyss,有什麼想法? – Abram

回答

0

我遇到同樣的問題。

突然我注意到我正在使用全球eslint包。如果沒有全局eslint-config-airbnb,則會出現錯誤。

我解決它通過npm install eslint --save-dev & & npm uninstall eslint -g

可以幫你。