npm start 時報 node_modules/nan 錯誤


> node devServer.js

Listening at http://localhost:3001
node_modules/nan
resolve failed for "caniuse-db": Error: Cannot find module 'caniuse-db'
resolve failed for "babel-runtime": Error: Cannot find module 'babel-runtime'
resolve failed for "webpack-core": Error: Cannot find module 'webpack-core'
/Users/elvinlong/m.zentrust.cn/node_modules/webpack-core/lib/NormalModuleMixin.js:151
				throw e;
				^

TypeError: Cannot read property 'displayName' of undefined


解決方法
修改.babelrc文件

{
  "presets": [
    "es2015-loose", // 改為 ["es2015", { "loose":true }],
    "stage-0",
    "react"
  ],
  "plugins": [
    "transform-decorators-legacy",
    "transform-class-properties"
  ],
  "env": {
    "development": {
      "plugins": [
        "react-hot-loader/babel"
      ]
    },
    "production": {
    }
  }
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM