こんにちは。
rails環境で、react.jsを利用しています。
react.js内でrequireを使いたいため、
以下を参考にbrowserify-railsをインストールしました。
http://qiita.com/tektoh/items/59afcc6ab6c4b34de22f
インストール後アプリにアクセスすると以下のエラーが発生しました。
Unable to run node_modules/.bin/browserify. Ensure you have installed it with npm.
どのように対応すればよいでしょうか?
お分かりになる方教えてください。
{アプリのルートディレクトリ}/node_modulesは以下のようになっています。
[ruby@vagrant-centos64 taskan]$ ls -la node_modules/
total 52
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:47 .
drwxrwxrwx 1 vagrant vagrant 8192 Sep 2 14:48 ..
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:40 babel-core
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:40 babelify
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:40 babel-plugin-add-module-exports
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:40 babel-preset-es2015
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:40 babel-preset-react
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:47 browserify
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:47 browserify-incremental
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:40 react
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:40 react-dom
drwxrwxrwx 1 vagrant vagrant 4096 Sep 2 14:34 react-modal
package.jsonは以下のようになっています。
{ "name": "testapp", "version": "1.0.0", "description": "== README", "main": "index.js", "directories": { "test": "test" }, "dependencies": { "babel-preset-react": "^6.11.1", "babel-preset-es2015": "^6.14.0", "babel-core": "^6.14.0", "babel-plugin-add-module-exports": "^0.2.1", "browserify": "^13.1.0", "babelify": "^7.3.0", "react": "^15.3.1", "browserify-incremental": "^3.1.1", "react-modal": "^1.4.0", "react-dom": "^15.3.1" }, "devDependencies": { "browserify": "^13.1.0", "browserify-incremental": "^3.1.1" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", "url": "https://xxxxxxxxxxx@github.com/xxxxxxxxxxxxxx" }, "author": "", "license": "ISC", "bugs": { "url": "https://github.com/xxxxxxxxxxxxx" }, "homepage": "https://github.com/xxxxxxxxxxxx" }
あなたの回答
tips
プレビュー