1. 程式人生 > >This dependency was not found: * common/stylus/index.styl in ./src/main.js To install it, you can ru

This dependency was not found: * common/stylus/index.styl in ./src/main.js To install it, you can ru

有如下錯誤:

This dependency was not found:

* common/stylus/index.styl in ./src/main.js

To install it, you can run: npm install --save common/stylus/index.styl

解決:

1、首先 npm install stylus-loader stylus --save-dev 

2、然後 build\webpack.base.conf.js

將 resolve新增

resolve: {
 extensions: ['.js', '.vue', '.json'],
  alias: {
    '@': resolve('src'),
    'common': resolve('src/common')//resolve轉化為絕對路徑,用到node.js中path.join()方法
  }
},