Heroku Local Deploy failed - node.js

I am trying to deply the heroku server and run into this error. I included the Procfile.txt in the root folder and inside that text file i have web:npm start
$ heroku local web
[OKAY] Loaded ENV .env File as KEY=VALUE Format
[WARN] ENOENT: no such file or directory, open 'Procfile'
[OKAY] package.json file found - trying 'npm start'
9:42:52 PM web.1 | 'npm' is not recognized as an internal or external command,
9:42:52 PM web.1 | operable program or batch file.
[DONE] Killing all processes with signal SIGINT
9:42:52 PM web.1 Exited with exit code null

Related

Error: Command failed: adb shell am start -n .MainActivity

Currently I'm trying to run my react native application on my local device using react-native run-android. But I'm getting the following error:-
info Connecting to the development server... warn Failed to connect to
development server using "adb reverse": spawnSync adb ENOENT info
Starting the app... 'adb' is not recognized as an internal or external
command, operable program or batch file. error Failed to start the
app. Error: Command failed: adb shell am start -n
com.tna/com.tna.MainActivity
at makeError (C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules\execa\index.js:174:9)
at Function.module.exports.sync (C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules\execa\index.js:338:15)
at tryLaunchAppOnDevice (C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules#react-native-community\cli-platform-android\build\commands\runAndroid\tryLaunchAppOnDevice.js:58:22)
at C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:104:39
at Array.forEach ()
at runOnAllDevices (C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:102:48)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules#react-native-community\cli\build\index.js:186:9) info Run CLI with --verbose flag for more details.
My current node version is 12.14.0

Seeing error Module not found: 'pg-native' in heroku app

I'm attempting to use the postgres add-on with a heroku node app that is also using react.
I'm using this react buildpack to support react inside heroku:
https://github.com/opike/create-react-app-buildpack.git
When I try to add the line:
var pg = require('pg');
I get the following compilation error when I try to run the heroku app locally:
>heroku local web
[OKAY] Loaded ENV .env File as KEY=VALUE Format
[WARN] ENOENT: no such file or directory, open 'Procfile'
[OKAY] package.json file found - trying 'npm start'
4:15:19 PM web.1 | > test-app#0.1.0 start /Users/oliverpike/dev/heroku/ofp-react
4:15:19 PM web.1 | > react-scripts start
4:15:20 PM web.1 | Starting the development server...
4:15:29 PM web.1 | Failed to compile.
4:15:29 PM web.1 | Error in ./~/pg/lib/native/index.js
4:15:29 PM web.1 | Module not found: 'pg-native' in /Users/oliverpike/dev/heroku/ofp-react/node_modules/pg/lib/native
4:15:29 PM web.1 | # ./~/pg/lib/native/index.js 1:13-33
4:15:29 PM web.1 | Error in ./~/pg/lib/connection-parameters.js
4:15:29 PM web.1 | Module not found: 'dns' in /Users/oliverpike/dev/heroku/ofp-react/node_modules/pg/lib
4:15:29 PM web.1 | # ./~/pg/lib/connection-parameters.js 2:10-24
I was able to get past this issue by doing an:
> npm i pg-native
as described here:
https://github.com/brianc/node-pg-native
as well as an
> npm i dns
for the dns issue.
The odd thing was that I didn't need to explicitly install these packages in my other heroku app that is using postgres.

Launch Appium with Command Line

When I'm using Appium client, I checked the logs and the first command of this seems like C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --app C:\Users\IEUser\Desktop\Mobil\Applications\eribank.apk --app-activity .LoginActivity --app-pkg com.experitest.ExperiBank --device-ready-timeout 300 --platform-name Android --platform-version 18 --automation-name Appium --device-name "emulator-5554" --log-no-color. But I want to call this command from command line without Appium client. When I'm trying to 'node "C:\Program Files (x86)\Appium\node.exe lib\server\main.js" --address 127.0.0.1 --port 4723 --app "C:\Users\IEUser\Desktop\Mobil\Applications\eribank.apk" --app-activity .LoginActivity --app-pkg com.experitest.ExperiBank --device-ready-timeout 300 --platform-name Android --platform-version 18 --automation-name Appium --device-name "emulator-5554" --log-no-color', I got the
module.js:327
throw err;
^
Error: Cannot find module 'C:\Program Files (x86)\Appium\node.exe lib\server\main.js'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:974:3
There isn't file directory as "C:\Program Files (x86)\Appium\node.exe lib\server\main.js". How can I call appium server by command myself? Thanks.
I am not 100% sure and do not have access to my appium computer atm. I believe the issue is that you are trying to run a .exe file not the lib\server\main.js file. Meaning those paths should be separated.
Try running it as shown below:
"C:\Program Files (x86)\Appium\node.exe" lib\server\main.js <rest of commandline arguments>
Hope that solves your issue. Sorry I can't verify on my own setup.
If you try to run appium without arguments, it works?
"C:\Program Files (x86)\Appium\node.exe" lib\server\main.js
You will have to see default values and appium started
[info] [Appium] Welcome to Appium v1.7.0
[info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] --> GET /wd/hub/sessions {}
I don't know if it will work... But I think you are trying to run a different main.js... Default path for my appium-desktop v1.7.0 is
C:\Users\your_username\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\build\lib\main.js
Maybe if you try with absolute paths?
"C:\Program Files (x86)\Appium\node.exe" "C:\Users\your_username\AppData\Local\Programs\appium-desktop\resources\app\node_modules\appium\build\lib\main.js"

Grunt error when running Sails.js app in Amazon ElasticBeanstalk

I am moving a Sails.js app hosted on Heroku to Amazon ElasticBeanstalk. When the application launches, it throws the following Grunt error (pulled from eb logs):
info: Sails <| .-..-.
info: v0.11.5 |\
info: /|.\
info: / || \
info: ,' |' \
info: .-'.-==|/_--'
info: `--'-------'
info: __---___--___---___--___---___--___
info: ____---___--___---___--___---___--___-__
info:
info: Server lifted in `/var/app/current`
info: To see your app, visit http://localhost:8081
info: To shut down Sails, press <CTRL> + C at any time.
debug: --------------------------------------------------------
debug: :: Mon Feb 29 2016 08:21:46 GMT+0000 (UTC)
debug: Environment : development
debug: Port : 8081
debug: --------------------------------------------------------
error: ** Grunt :: An error occurred. **
error:
------------------------------------------------------------------------
>> FileError: '../bower_components/bootstrap/less/grid.less' wasn't found in assets/styles/importer.less on line 9, column 1:
>> 8 // Import Bootstrap
>> 9 #import "../bower_components/bootstrap/less/grid.less";
>> 10 #import "../bower_components/bootstrap/less/mixins.less";
Warning: Error compiling assets/styles/importer.less
Aborted due to warnings.
Running "less:dev" (less) task
------------------------------------------------------------------------
error: Looks like a Grunt error occurred--
error: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `/var/app/current/.tmp` ?
error:
error: If you think this might be the case, try running:
error: sudo chown -R 497 /var/app/current/.tmp
The same code runs fine on my local development laptop and on Heroku but not on ElasticBeanstalk. Why is it unable to find the bootstrap files? This being a PaaS, I can't even run the recommended sudo chown command that the log recommended. Also to be clear, I have the following command in my package.json file:
"scripts": {
"postinstall": "bower install; grunt build",
"debug": "node debug app.js",
"start": "node app.js"
}
I have instructed the script to run bower install after the NPM packages are installed in the machine. None of the images in my /assets folder seem to load either. Not sure what's going on. Please help.

Running node.js w/ supervisor in win8

I'm trying to get my node server running w/ supervisor. I had it working in Windows 7, but now it keeps failing. Here's the output:
"C:\Program Files\nodejs\node.exe" C:\Users\Mark\AppData\Roaming\npm\node_modules\supervisor\lib\cli-wrapper.js --no-restart-on error server.js
DEBUG: Running node-supervisor with
CreateProcessW: The system cannot find the file specified.
DEBUG: program 'server.js'
DEBUG: --watch '.'
DEBUG: --ignore 'undefined'
DEBUG: --extensions 'node|js'
DEBUG: --exec 'node'
DEBUG: Starting child process with 'node server.js'
DEBUG: Watching directory 'D:\Websites\MyProject' for changes.
DEBUG: Program node server.js exited with code 127
This guy suggested trying nodemon instead, but the result is more or less the same:
"C:\Program Files\nodejs\node.exe" C:\Users\Mark\AppData\Roaming\npm\node_modules\nodemon\nodemon.js server.js
26 Jan 22:23:10 - [nodemon] v0.7.1
26 Jan 22:23:10 - [nodemon] watching: D:\Websites\MyProject
26 Jan 22:23:10 - CreateProcessW: The system cannot find the file specified.
[nodemon] starting `node server.js`
26 Jan 22:23:10 - [nodemon] app crashed - waiting for file changes before starting...
However, if I run "vanilla" node.js, it starts up fine:
"C:\Program Files\nodejs\node.exe" server.js
Listening on http://localhost:8081
What might be the problem? Is it the server.js file it can't find? Why wouldn't it be able to find it?
Rebooted Windows, problem went away. It starts up fine now. Probably just needed to restart either Windows or my IDE to refresh some file paths :-)

Resources