Closed jtejido closed 8 years ago
Could you provide some more information on your setup? It seems you're facing a nodejs / npm problem.
Could you provide your OS version, node version and npm version? Are you using nvm?
Also, you should avoid running sudo npm install
but favor npm install
in your work directory. sudo npm install
should be reserved for install global packages only.
You can also have a look at this guide from a helpful user and this guide from the npm docs on how to deal with permissions for globally installed packages.
I fixed this by adding the
var Promise = require('es6-promise').Promise;
//Or require('es6-promise').polyfill();
to the webpack.config.js
// or to the node_modules/postcss/lib/lazy-result.js )
jtejido@MYSTATSDEVOPS:~/phoenix$ sudo npm install -g webpack [sudo] password for jtejido: /usr/bin/webpack -> /usr/lib/node_modules/webpack/bin/webpack.js /usr/lib └── webpack@1.12.14
npm WARN optional Skipping failed optional dependency /webpack/chokidar/fsevents : npm WARN notsup Not compatible with your operating system or architecture: fseve nts@1.0.8 jtejido@MYSTATSDEVOPS:~/phoenix$ sudo npm install npm WARN optional Skipping failed optional dependency /chokidar/fsevents: npm WARN notsup Not compatible with your operating system or architecture: fseve nts@1.0.8 jtejido@MYSTATSDEVOPS:~/phoenix$ sudo mix phoenix.server [info] Running PhoenixTrello.Endpoint with Cowboy using http on port 4000 Hash: 07dbee432140fef4b825 Version: webpack 1.12.14 Time: 3436ms Asset Size Chunks Chunk Names js/application.js 1.89 MB 0 [emitted] application [0] multi application 40 bytes {0} [built]
ERROR in ./~/css-loader!./~/sass-loader?indentedSyntax&includePaths[]=/home/jtej ido/phoenix/node_modules!./web/static/css/application.sass Module build failed: ReferenceError: Promise is not defined at LazyResult.async (/home/jtejido/phoenix/node_modules/postcss/lib/lazy-res ult.js:157:31) at LazyResult.then (/home/jtejido/phoenix/node_modules/postcss/lib/lazy-resu lt.js:79:21) at processCss (/home/jtejido/phoenix/node_modules/css-loader/lib/processCss. js:198:5) at Object.module.exports (/home/jtejido/phoenix/node_modules/css-loader/lib/ loader.js:24:2) @ ./web/static/css/application.sass 4:14-199
ERROR in ./web/static/css/application.sass Module build failed: ModuleBuildError: Module build failed: ReferenceError: Prom ise is not defined at LazyResult.async (/home/jtejido/phoenix/node_modules/postcss/lib/lazy-res ult.js:157:31) at LazyResult.then (/home/jtejido/phoenix/node_modules/postcss/lib/lazy-resu lt.js:79:21) at processCss (/home/jtejido/phoenix/node_modules/css-loader/lib/processCss. js:198:5) at Object.module.exports (/home/jtejido/phoenix/node_modules/css-loader/lib/ loader.js:24:2) at DependenciesBlock.onModuleBuildFailed (/home/jtejido/phoenix/node_modules /webpack-core/lib/NormalModuleMixin.js:315:19) at nextLoader (/home/jtejido/phoenix/node_modules/webpack-core/lib/NormalMod uleMixin.js:270:31) at /home/jtejido/phoenix/node_modules/webpack-core/lib/NormalModuleMixin.js: 292:15 at runSyncOrAsync (/home/jtejido/phoenix/node_modules/webpack-core/lib/Norma lModuleMixin.js:173:4) at nextLoader (/home/jtejido/phoenix/node_modules/webpack-core/lib/NormalMod uleMixin.js:290:3) at /home/jtejido/phoenix/node_modules/webpack-core/lib/NormalModuleMixin.js: 292:15 at context.callback (/home/jtejido/phoenix/node_modules/webpack-core/lib/Nor malModuleMixin.js:148:14) at Object.onRender (/home/jtejido/phoenix/node_modules/sass-loader/index.js: 287:9) at /home/jtejido/phoenix/node_modules/async/lib/async.js:906:35 at _arrayEach (/home/jtejido/phoenix/node_modules/async/lib/async.js:85:13) at Object. (/home/jtejido/phoenix/node_modules/async/lib/async.js :898:17)
at Object.callback (/home/jtejido/phoenix/node_modules/async/lib/async.js:44 :16)
at options.success (/home/jtejido/phoenix/node_modules/node-sass/lib/index.j s:294:32)
Child extract-text-webpack-plugin:
[info] GET / [debug] Processing by PhoenixTrello.PageController.index/2 Parameters: %{"path" => []} Pipelines: [:browser] [info] Sent 200 in 40ms [info] GET /css/application.css [debug] Processing by PhoenixTrello.PageController.index/2 Parameters: %{"path" => ["css", "application.css"]} Pipelines: [:browser] [info] Sent 200 in 252µs