why babel stores .babel.json in USERPROFILE path

前端 未结 4 1504
小蘑菇
小蘑菇 2021-01-04 11:33

I\'m running a nodejs app on azure web apps and i\'m trying to integrate babel using npm in it. The problem is that babel is trying to acccess a file at

4条回答
  •  逝去的感伤
    2021-01-04 11:58

    The error appeared when i tried load babel/register.

    Please check the Cache.js at (..\node_modules\babel\node_modules\babel-core\lib\api\register\Cache.js) to see if there is any babel cache path definition, e.g.

    process.env.BABEL_CACHE_PATH || _path2["default"].join(_homeOrTmp2["default"], ".babel.json");
    

    If you leverage this kind of variables, it's needed to have BABEL_CACHE_PATH app setting key and value of ./cache otherwise anything with babel wouldn't work on azure. Please refer to http://blog.syntaxc4.net/post/2012/07/26/accessing-app-settings-configured-in-microsoft-azure-web-sites-using-php-and-node-js.aspx in case you wanna know the details of accessing app settings in Azure web site using node.js.

    Should you have any further concern, please feel free to let us know.

提交回复
热议问题