When I tried to use the following preparations, I got a browserify related error.
(1) node.js is already installed (installed when building the rails environment)
(2) Install browserify
(3) Install browserify-rails
When the page is displayed in the browser, the following error occurs.
Unable to run node_modules/.bin/browserify.Ensure you have installed it with npm.
-I moved the js file for writing files from the command prompt.
const fs = require ('fs') fs.writeFileSync ("output.txt", "hello, world")
-The file join operation using browserify from the command prompt has been successfully completed.
$browserify main.js -o build.js
(OS) Windows 10
(WSL) Ubuntu 18.04.2 LTS
There was an error message "Unable to run node_modules/.bin/browserify."
When I checked the above path, there was no browserify in ./bin.
(Path: app/node_modules/.bin /)
Thank you for helping me if you understand the possible cause (´;ω;｀)
Answer # 1
Although browserify is probably installed in the global area,
When Rails browses browserify, it looks for the node_module under the project directory, so browserify is not found under node_modules and it seems that an error has occurred.
In the project directory,
npm install -S browserify
to try a local installation of browserify.