autoprefixerとpostcssを使用し、新しいLinuxサーバーに移動した後、何かが間違っている必要がありますが、これが何であるか把握できません。 、私はこの問題を調査したが、問題の発生がすべてのNode.jsの非常に初期のバージョンのように見える「プロミスは定義されていません」と表示されるのはなぜですか?ノードv5.7.0のエラー
var autoprefixer = require('autoprefixer');
var postCSS = require('postcss');
function prefix(css, res, type, fullPath) {
postCSS([autoprefixer]).process(css).then(function(result) {
var css = result.css;
var length = css.length;
res.writeHead(200, {
'Content-Length' : length,
'Content-Type' : type
});
res.write(css);
res.end();
});
}
:
/home/ec2-user/Enviziion/Muveoo/Server/node_modules/postcss/lib/lazy-result.js:157
this.processing = new Promise(function (resolve, reject) {
^
ReferenceError: Promise is not defined
によってトリガーされる:私はエラーを取得しています例えば:
解決策は常に「更新ノード」のようです。
しかし、鉱山は最新のものであるように思わ:
[[email protected] Server]$ node -v
v5.7.0
何私の問題はここにあるかもしれませんか?
このコマンドを試してください: – Alexandre
@Alexandre '〜/ .nvm/versions/node/v5.7.0/bin/node' –
この解決策を試してください:http://stackoverflow.com/questions/32490328/gulp -autoprefixer-throwing-referenceerror-promise-is-not-defined#答え-32502195 – Alexandre