I can not run the server

When I try to run the server with foreman start -f Procfile.static :

14:36:51 rails.1               | started with pid 31652
14:36:51 rails-client-assets.1 | started with pid 31653
14:36:51 rails-server-assets.1 | started with pid 31655
14:36:51 rails.1               | Waiting for app/assets/webpack/server-bundle.js...
14:36:51 rails-client-assets.1 | Skipping routes export task. Routes file ./client/app/routes/routes.js exists already.
14:36:51 rails-server-assets.1 | Skipping translation export task. Translation bundle ./client/app/i18n/all.js exists already.
14:36:51 rails.1               | app/assets/webpack/server-bundle.js found
14:36:51 rails-server-assets.1 | Waiting for client/app/routes/routes.js...
14:36:51 rails-server-assets.1 | client/app/routes/routes.js found
14:36:52 rails-server-assets.1 | 
14:36:52 rails-server-assets.1 | > @ build:dev:server /usr/share/nginx/html/galeones/client
14:36:52 rails-server-assets.1 | > npm run ensure-node-version && webpack -w --config webpack.server.config.js
14:36:52 rails-server-assets.1 | 
14:36:52 rails-client-assets.1 | 
14:36:52 rails-client-assets.1 | > @ build:dev:client /usr/share/nginx/html/galeones/client
14:36:52 rails-client-assets.1 | > npm run ensure-node-version && webpack -w --config webpack.client.config.js
14:36:52 rails-client-assets.1 | 
14:36:54 rails-client-assets.1 | 
14:36:54 rails-client-assets.1 | > @ ensure-node-version /usr/share/nginx/html/galeones/client
14:36:54 rails-client-assets.1 | > check-node-version --package
14:36:54 rails-client-assets.1 | 
14:36:54 rails-server-assets.1 | 
14:36:54 rails-server-assets.1 | > @ ensure-node-version /usr/share/nginx/html/galeones/client
14:36:54 rails-server-assets.1 | > check-node-version --package
14:36:54 rails-server-assets.1 | 
14:36:54 rails-client-assets.1 | /usr/share/nginx/html/galeones/client/node_modules/.bin/check-node-version: 1: /usr/share/nginx/html/galeones/client/node_modules/.bin/check-node-version: ../check-node-version/bin.js: not found
14:36:54 rails-server-assets.1 | /usr/share/nginx/html/galeones/client/node_modules/.bin/check-node-version: 1: /usr/share/nginx/html/galeones/client/node_modules/.bin/check-node-version: ../check-node-version/bin.js: not found
14:36:54 rails-server-assets.1 | 
14:36:54 rails-client-assets.1 | 
14:36:54 rails-client-assets.1 | npm ERR! Linux 4.4.0-1022-aws
14:36:54 rails-server-assets.1 | npm ERR! Linux 4.4.0-1022-aws
14:36:54 rails-server-assets.1 | npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "ensure-node-version"
14:36:54 rails-client-assets.1 | npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "ensure-node-version"
14:36:54 rails-client-assets.1 | npm ERR! node v6.9.5
14:36:54 rails-client-assets.1 | npm ERR! npm  v3.10.10
14:36:54 rails-client-assets.1 | npm ERR! file sh
14:36:54 rails-client-assets.1 | npm ERR! code ELIFECYCLE
14:36:54 rails-client-assets.1 | npm ERR! errno ENOENT
14:36:54 rails-client-assets.1 | npm ERR! syscall spawn
14:36:54 rails-client-assets.1 | npm ERR! @ ensure-node-version: `check-node-version --package`
14:36:54 rails-client-assets.1 | npm ERR! spawn ENOENT
14:36:54 rails-client-assets.1 | npm ERR! 
14:36:54 rails-client-assets.1 | npm ERR! Failed at the @ ensure-node-version script 'check-node-version --package'.
14:36:54 rails-client-assets.1 | npm ERR! Make sure you have the latest version of node.js and npm installed.
14:36:54 rails-client-assets.1 | npm ERR! If you do, this is most likely a problem with the  package,
14:36:54 rails-client-assets.1 | npm ERR! not with npm itself.
14:36:54 rails-client-assets.1 | npm ERR! Tell the author that this fails on your system:
14:36:54 rails-client-assets.1 | npm ERR!     check-node-version --package
14:36:54 rails-client-assets.1 | npm ERR! You can get information on how to open an issue for this project with:
14:36:54 rails-client-assets.1 | npm ERR!     npm bugs 
14:36:54 rails-client-assets.1 | npm ERR! Or if that isn't available, you can get their info via:
14:36:54 rails-client-assets.1 | npm ERR!     npm owner ls 
14:36:54 rails-client-assets.1 | npm ERR! There is likely additional logging output above.
14:36:54 rails-server-assets.1 | npm ERR! node v6.9.5
14:36:54 rails-server-assets.1 | npm ERR! npm  v3.10.10
14:36:54 rails-server-assets.1 | npm ERR! file sh
14:36:54 rails-server-assets.1 | npm ERR! code ELIFECYCLE
14:36:54 rails-server-assets.1 | npm ERR! errno ENOENT
14:36:54 rails-server-assets.1 | npm ERR! syscall spawn
14:36:54 rails-server-assets.1 | npm ERR! @ ensure-node-version: `check-node-version --package`
14:36:54 rails-server-assets.1 | npm ERR! spawn ENOENT
14:36:54 rails-server-assets.1 | npm ERR! 
14:36:54 rails-server-assets.1 | npm ERR! Failed at the @ ensure-node-version script 'check-node-version --package'.
14:36:54 rails-server-assets.1 | npm ERR! Make sure you have the latest version of node.js and npm installed.
14:36:54 rails-server-assets.1 | npm ERR! If you do, this is most likely a problem with the  package,
14:36:54 rails-server-assets.1 | npm ERR! not with npm itself.
14:36:54 rails-server-assets.1 | npm ERR! Tell the author that this fails on your system:
14:36:54 rails-server-assets.1 | npm ERR!     check-node-version --package
14:36:54 rails-server-assets.1 | npm ERR! You can get information on how to open an issue for this project with:
14:36:54 rails-server-assets.1 | npm ERR!     npm bugs 
14:36:54 rails-server-assets.1 | npm ERR! Or if that isn't available, you can get their info via:
14:36:54 rails-server-assets.1 | npm ERR!     npm owner ls 
14:36:54 rails-server-assets.1 | npm ERR! There is likely additional logging output above.
14:36:54 rails-server-assets.1 | 
14:36:54 rails-server-assets.1 | npm ERR! Please include the following file with any support request:
14:36:54 rails-server-assets.1 | npm ERR!     /usr/share/nginx/html/galeones/client/npm-debug.log
14:36:54 rails-client-assets.1 | 
14:36:54 rails-client-assets.1 | npm ERR! Please include the following file with any support request:
14:36:54 rails-client-assets.1 | npm ERR!     /usr/share/nginx/html/galeones/client/npm-debug.log
14:36:54 rails-client-assets.1 | 
14:36:54 rails-server-assets.1 | 
14:36:54 rails-client-assets.1 | npm ERR! Linux 4.4.0-1022-aws
14:36:54 rails-server-assets.1 | npm ERR! Linux 4.4.0-1022-aws
14:36:54 rails-server-assets.1 | npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build:dev:server"
14:36:54 rails-server-assets.1 | npm ERR! node v6.9.5
14:36:54 rails-server-assets.1 | npm ERR! npm  v3.10.10
14:36:54 rails-server-assets.1 | npm ERR! code ELIFECYCLE
14:36:54 rails-server-assets.1 | npm ERR! @ build:dev:server: `npm run ensure-node-version && webpack -w --config webpack.server.config.js`
14:36:54 rails-server-assets.1 | npm ERR! Exit status 1
14:36:54 rails-client-assets.1 | npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build:dev:client"
14:36:54 rails-client-assets.1 | npm ERR! node v6.9.5
14:36:54 rails-client-assets.1 | npm ERR! npm  v3.10.10
14:36:54 rails-client-assets.1 | npm ERR! code ELIFECYCLE
14:36:54 rails-client-assets.1 | npm ERR! @ build:dev:client: `npm run ensure-node-version && webpack -w --config webpack.client.config.js`
14:36:54 rails-client-assets.1 | npm ERR! Exit status 1
14:36:54 rails-client-assets.1 | npm ERR! 
14:36:54 rails-client-assets.1 | npm ERR! Failed at the @ build:dev:client script 'npm run ensure-node-version && webpack -w --config webpack.client.config.js'.
14:36:54 rails-client-assets.1 | npm ERR! Make sure you have the latest version of node.js and npm installed.
14:36:54 rails-client-assets.1 | npm ERR! If you do, this is most likely a problem with the  package,
14:36:54 rails-client-assets.1 | npm ERR! not with npm itself.
14:36:54 rails-client-assets.1 | npm ERR! Tell the author that this fails on your system:
14:36:54 rails-server-assets.1 | npm ERR! 
14:36:54 rails-client-assets.1 | npm ERR!     npm run ensure-node-version && webpack -w --config webpack.client.config.js
14:36:54 rails-client-assets.1 | npm ERR! You can get information on how to open an issue for this project with:
14:36:54 rails-client-assets.1 | npm ERR!     npm bugs 
14:36:54 rails-client-assets.1 | npm ERR! Or if that isn't available, you can get their info via:
14:36:54 rails-client-assets.1 | npm ERR!     npm owner ls 
14:36:54 rails-client-assets.1 | npm ERR! There is likely additional logging output above.
14:36:54 rails-server-assets.1 | npm ERR! Failed at the @ build:dev:server script 'npm run ensure-node-version && webpack -w --config webpack.server.config.js'.
14:36:54 rails-server-assets.1 | npm ERR! Make sure you have the latest version of node.js and npm installed.
14:36:54 rails-server-assets.1 | npm ERR! If you do, this is most likely a problem with the  package,
14:36:54 rails-server-assets.1 | npm ERR! not with npm itself.
14:36:54 rails-server-assets.1 | npm ERR! Tell the author that this fails on your system:
14:36:54 rails-server-assets.1 | npm ERR!     npm run ensure-node-version && webpack -w --config webpack.server.config.js
14:36:54 rails-server-assets.1 | npm ERR! You can get information on how to open an issue for this project with:
14:36:54 rails-server-assets.1 | npm ERR!     npm bugs 
14:36:54 rails-server-assets.1 | npm ERR! Or if that isn't available, you can get their info via:
14:36:54 rails-server-assets.1 | npm ERR!     npm owner ls 
14:36:54 rails-server-assets.1 | npm ERR! There is likely additional logging output above.
14:36:54 rails-client-assets.1 | 
14:36:54 rails-client-assets.1 | npm ERR! Please include the following file with any support request:
14:36:54 rails-server-assets.1 | 
14:36:54 rails-server-assets.1 | npm ERR! Please include the following file with any support request:
14:36:54 rails-server-assets.1 | npm ERR!     /usr/share/nginx/html/galeones/client/npm-debug.log
14:36:54 rails-client-assets.1 | npm ERR!     /usr/share/nginx/html/galeones/client/npm-debug.log
14:36:55 rails-client-assets.1 | exited with code 1
14:36:55 system                | sending SIGTERM to all processes
14:36:55 rails-server-assets.1 | exited with code 1
14:36:55 rails.1               | terminated by SIGTERM

Help please! Thank you.

I know it’s a problem of npm. When I do sudo npm install it’s return this:

npm WARN lifecycle undefined~postinstall: cannot run in wd %s %s (wd=%s) undefined cd client && npm install /usr/share/nginx/html/galeones
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

And after do cd client && npm install:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}

Don’t use sudo to install npm packages it’s not safe and thay will be installed in root directory. Just npm install and check your version for node and npm for local user.

Thank you very much!

I do npm install without sudo and it return this:

ubuntu@ip-10-0-2-115:/usr/share/nginx/html/galeones$ npm install
npm WARN update-linked node_modules/webpack needs updating to 2.7.0 from 3.6.0 but we can't, as it's a symlink

> undefined postinstall /usr/share/nginx/html/galeones
> cd client && npm install

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Then I do cd client && npm install and the return is:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Something I can do?

The node version is 6.9.5 and npm version is 3.10.10

you must use node 7.8. Check docs technology-stack

I upgrade to node 7.8 and do npm install:

npm WARN update-linked node_modules/webpack needs updating to 2.7.0 from 3.6.0 but we can't, as it's a symlink

> undefined postinstall /usr/share/nginx/html/galeones 
> cd client && npm install

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

and cd client && npm install:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Thank you stakoov.

Thanks, Its working when use node 7.8.0