HTML - Autoprefixer - トラブルシュート - gulp がこける(errors.unsupportedEnvironment)

クラウディア 
1. 概要
2. 現在のバージョンを確認
3. インストールしなおし経過

1. 概要

 またもや、久々(2019年5月10日)に起動してみましたらば・・・。

> gulp exp
/パス/npm/node_modules/node-sass/lib/binding.js:13
      throw new Error(errors.unsupportedEnvironment());
      ^

Error: Node Sass does not yet support your current environment: FreeBSD 64-bit with Unsupported runtime (72)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.11.0
    at module.exports (/パス/npm/node_modules/node-sass/lib/binding.js:13:13)
    at Object.<anonymous> (/パス/npm/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/パス/npm/node_modules/gulp-sass/index.js:162:21)
    at Module._compile (internal/modules/cjs/loader.js:759:30)
gmake: *** [Makefile:31: exp] エラー 1
 「Node Sass does not yet support your current environment: FreeBSD 64-bit with Unsupported runtime」とな。  「FreeBSD 64-bit」は、サポートしてないと?  いあいあ、先日まで動作していたはずなので・・・、またバージョンアップがあったかなぁ・・・。

2. 現在のバージョンを確認

 とりあえず、gulp と node のバージョンを確認。

> gulp -v
CLI version 2.1.0
Local version 4.0.0
> node -v
v12.2.0
 何? CLI と Local のバージョンがずれている?  node のバージョンが 12.2.0 ですと。  ports で提供されているバージョンを確認してみます。

> ls -d /usr/ports/www/node*
/usr/ports/www/node  /usr/ports/www/node10  /usr/ports/www/node6  /usr/ports/www/node8
 うむぅ、このままインストールしなおすか、10 に戻してインストールしなおしか、8 に戻してインストールしなおしか・・・。  最新のものから順に、バージョンを下げていきますか・・・。

3. インストールしなおし経過

 いちいち経過の細かいところまでは、書きません。  インストール方法は、「HTML - Autoprefixer(Node.js・gulp)- 環境構築(Node.js・npm)」あたりをご参照ください。  キーとなる個所だけ書いていきます。  node 12.2.0 のまま実行しようとすると

npm init
npm install --save-dev gulp
 2個目でエラーになりました。  エラーメッセージが

gmake: *** [binding.target.mk:127: Release/obj.target/binding/src/create_string.o] エラー 1
gmake: ディレクトリ '/ユーザパス/node_modules/node-sass/build' から出ます
gyp ERR! build error
gyp ERR! stack Error: `gmake` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/ユーザパス/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:257:12)
gyp ERR! System FreeBSD 11.2-RELEASE-p4
gyp ERR! command "/usr/local/bin/node" "/ユーザパス/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /ユーザパス/node_modules/node-sass
gyp ERR! node -v v12.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN npm@1.0.0 No description
npm WARN npm@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"freebsd","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.11.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /ユーザパス/.npm/_logs/2019-05-10T02_52_30_019Z-debug.log
 斜めに読んで・・・。  「wanted {"os":"darwin","arch":"any"} (current: {"os":"freebsd","arch":"x64"})」ってとこですかね。  node 12 は、だめそうなので、アンインストールして、node 10 をいれてやってみます。  node の再インストールは、以下の手順で(オプションはフルにしました)。

cd /usr/ports/www/node
make deinstall clean
cd /usr/ports/www/node10
make
make install
 その後、ユーザで。

~/npm
 配下に環境を構築しますので、元のディレクトリをリネームして環境構築します。

cd ~/
mv npm npm_bak
mkdir ~/npm
cd    ~/npm
npm init
npm install --save-dev gulp
npm audit fix --force
npm install --save-dev gulp-sass
npm audit fix --force
npm install --save-dev gulp-autoprefixer
npm audit fix --force
 これで、また実行できるようになりました。
ハイスピードプラン