以下のようなサイトなどを参考にしつつ、nw.jsをインストールしようとしましたが、上手くいきません。
環境は、vagrantを用いたubuntu64でやっております。nodeのバージョンはv4.2.3で、npmのバージョンは4.4.2です。
まず適当なディレクトリ(nw_test)を作り、その中に適当なhtmlファイル(index.html)を作ります。
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>初めてのnw</title>
</head>
<body>
<h1>初めてのnw</h1>
</body>
</html>
そのディレクトリで、以下のコマンドを実行します。
$ npm init
entry point (index.js) <== ここで index.html と答える
ここまではうまくいきます。
次に、以下のコマンドを実行すると次のようなエラーが出ます。
$ npm install --save nw
npm WARN nw_test@1.0.0 No description
npm WARN nw_test@1.0.0 No repository field.
npm ERR! path /home/vagrant/workspace/nw_test/node_modules/seek-bzip/bin/seek-bzip-table
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/home/vagrant/workspace/nw_test/node_modules/seek-bzip/bin/seek-bzip-table'
npm ERR! enoent ENOENT: no such file or directory, chmod '/home/vagrant/workspace/nw_test/node_modules/seek-bzip/bin/seek-bzip-table'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2017-03-14T07_38_29_980Z-debug.log
node_modulesの中を見ても、nwは入っておりませんし、package.jsonに
"start": "nw"
を書き加えて、
$ npm start
としても、
> nw_test@1.0.0 start /home/vagrant/workspace/nw_test
> nw
sh: 1: nw: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! nw_test@1.0.0 start: `nw`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the nw_test@1.0.0 start script 'nw'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the nw_test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! nw
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs nw_test
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls nw_test
npm ERR! There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2017-03-14T07_46_45_276Z-debug.log
とのエラーが出てしまいます。
他の方法も色々と試したのですが、自力では解決できませんでした。どなたか、教えていただければ幸いです。