尝试启动新的Elixir / Phoenix项目。无法解决该错误:
▶ mix phoenix.server
[info] Running Test.Endpoint with Cowboy using http on port 4000
05 Feb 16:32:57 - error: Initialization error - You probably need to execute `npm install` to install brunch plugins. Error: Cannot find module 'babel-runtime/helpers/interop-require-default'
at /home/vagrant/test/node_modules/brunch/lib/plugins.js:103:17
at Array.map (native)
at deps.filter.dependency.map (/home/vagrant/test/node_modules/brunch/lib/plugins.js:91:8)
at packages.filter.plugin.filter.plugins.map.plugin.filter.deps.filter.allPlugins.filter (/home/vagrant/test/node_modules/brunch/lib/plugins.js:110:19)
at Object.packages.filter.plugin.filter.plugins.map.plugin.filter.deps.filter.exports.init.teardownBrunch [as init] (/home/vagrant/test/node_modules/brunch/lib/plugins.js:133:20)
at /home/vagrant/test/node_modules/brunch/lib/watch.js:81:19
版本:
项目内容 package.json :
{
"repository": {
},
"dependencies": {
"babel-brunch": "~6.0.0",
"brunch": "~2.1.3",
"clean-css-brunch": "~1.8.0",
"css-brunch": "~1.7.0",
"javascript-brunch": "~1.8.0",
"uglify-js-brunch": "~1.7.0",
"phoenix": "file:deps/phoenix",
"phoenix_html": "file:deps/phoenix_html"
}
}
答案 0 :(得分:2)
显然现在Elixir需要node.js> = 5.0.0
我们可以从下载页面获取node.js.选择包时 下载,重要的是要注意Phoenix需要版本5.0.0 或更高。
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs
rm node_modules -r
npm install .
解决了问题