Grunt error when running Sails.js app in Amazon ElasticBeanstalk - node.js

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.

Related

Baileys | error while compiling example.ts file

I cloned this repository: https://github.com/adiwajshing/Baileys.
When I compile the example.ts file via the yarn example command, which is located in the ./Example/example.ts folder, the following error occurs:
PS D:\Programming\Web\Baileys> yarn example
yarn run v1.22.19
$ node --inspect -r ts-node/register Example/example.ts
Debugger listening on ws://127.0.0.1:9229/c6e4eec7-1dea-4762-8fa6-a10bcd74aa7a
For help, see: https://nodejs.org/en/docs/inspector
using WA v2.2243.7, isLatest: true
D:\Programming\Web\Baileys\src\Socket\socket.js:57
var ws = new ws_1["default"](waWebSocketUrl, undefined, {
^
TypeError: ws_1.default is not a constructor
at makeSocket (D:\Programming\Web\Baileys\src\Socket\socket.js:57:14)
at makeChatsSocket (D:\Programming\Web\Baileys\src\Socket\chats.js:63:40)
at makeGroupsSocket (D:\Programming\Web\Baileys\src\Socket\groups.js:57:44)
at makeMessagesSocket (D:\Programming\Web\Baileys\src\Socket\messages-send.js:61:46)
at makeMessagesRecvSocket (D:\Programming\Web\Baileys\src\Socket\messages-recv.js:62:55)
at makeBusinessSocket (D:\Programming\Web\Baileys\src\Socket\business.js:56:59)
at makeWASocket (D:\Programming\Web\Baileys\src\Socket\index.js:17:82)
at startSock (D:\Programming\Web\Baileys\Example\example.ts:31:27)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
what is it connected with?
node
v18.7.0
tsc
Version 4.9.4
yarn
1.12.19
I tried to solve the problem by changing the imports as mentioned here https://github.com/node-cache/node-cache/issues/59, but it didn't help.

Dev Script Doesn't Work In Remix With Cloud Flare Pages

I made a app with create-remix and I chose to use Cloud Flare Pages. Made the app but when I run npm run dev I get a error. I am on the latest node version (v17.3.1). I get this error the first time I run the dev script:
Watching Remix app in development mode...
Compiling worker to "/tmp/functionsWorker.js"...
✘ [ERROR] Could not resolve "../build"
functions/[[path]].js:4:23:
4 │ import * as build from "../build";
╵ ~~~~~~~~~~
1 error(s) and 0 warning(s) when compiling Worker.
Build failed with 1 error:
functions/[[path]].js:4:23: ERROR: Could not resolve "../build"
ERROR: "dev:wrangler" exited with 1.
Then if I run it again I get this error (probably because it builds the build folder the first time I run it before I get the error):
Watching Remix app in development mode...
Compiling worker to "/tmp/functionsWorker.js"...
✘ [ERROR] Could not resolve "../build"
functions/[[path]].js:4:23:
4 │ import * as build from "../build";
╵ ~~~~~~~~~~
1 error(s) and 0 warning(s) when compiling Worker.
Build failed with 1 error:
functions/[[path]].js:4:23: ERROR: Could not resolve "../build"
ERROR: "dev:wrangler" exited with 1.
Idk why I get this error as it is the default template. Thanks in advance.
I found out on the remix discord server that you need to downgrade versions to fix this. To do that just run npm install wrangler#beta

React Native app can't be started after upgrading to nodejs 12.13 from 10.13

My React Native used to run fine with 0.61.2 with Nodej 10.13. There is an error after upgrading to nodejs 12.13.0 when react-native run-android. Here is the error:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1461 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
FAILURE: Build failed with an exception.
* Where:
Script 'C:\D\code\js\emps_fe6\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 182
* What went wrong:
A problem occurred evaluating script.
> Text must not be null or empty
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* Where:
Script 'C:\D\code\js\emps_fe6\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 182
* What went wrong:
A problem occurred evaluating script.
> Text must not be null or empty
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\d\code\js\emps_fe6\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\d\code\js\emps_fe6\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\d\code\js\emps_fe6\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (C:\d\code\js\emps_fe6\node_modules\#react-native-community\cli\build\index.js:164:9)
./gradlew clean failed as well. What is wrong with the upgrade? Shall I roll back to nodejs 10.13?

trouble in sails lift on AWS server

when I am running the project with sails lift then it shows -
Aborted due to warnings.
Running "sails-linker:devTpl" (sails-linker) task
padding length 4
Warning: Unable to write "views/layout.ejs" file (Error code: EACCES).
------------------------------------------------------------------------
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/myproj/.tmp` ?
error:
error: If you think this might be the case, try running:
error: sudo chown -R 1000 /var/myproj/.tmp
I have tried all the given steps like provide access to .tmp and npm install
and when I am debugging the code by sails debus is shows :
Grunt :: Error: listen EADDRINUSE :::5858
at Object.exports._errnoException (util.js:860:11)
at exports._exceptionWithHostPort (util.js:883:20)
at Agent.Server._listen2 (net.js:1234:14)
at listen (net.js:1270:10)
at Agent.Server.listen (net.js:1366:5)
at Object.start (_debug_agent.js:21:9)
at startup (node.js:72:9)
at node.js:972:3
Strange part is its running on my local system and on normal(other) server very fine and correctly working.
You'll need to chmod the views directory

Deploy Meteor App To AMAZON EC2 using MUP Error

I'm trying to use METEOR UP MUP to deploy my Meteor App to AWS AMAZON EC2.
I use different NPM Modules as well as METEOR PACKAGES in my Meteor App. It all works perfectly on my computer.
When I do a mup deploy I get the following errors:
[52.89.165.48] - Uploading bundle
[52.89.165.48] - Uploading bundle: SUCCESS
[52.89.165.48] - Setting up Environment Variables
[52.89.165.48] - Setting up Environment Variables: SUCCESS
[52.89.165.48] - Invoking deployment process
[52.89.165.48] x Invoking deployment process: FAILED
-----------------------------------STDERR-----------------------------------
sseph.h:4:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4251)
^
In file included from ../src/house.cc:1:0:
../src/swisseph.h:4:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4251)
^
In file included from ../src/eclipse.cc:1:0:
../src/swisseph.h:4:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4251)
^
gyp info ok
npm WARN package.json meteor-dev-bundle#0.0.0 No description
npm WARN package.json meteor-dev-bundle#0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle#0.0.0 No README data
stop: Unknown instance:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to localhost port 80: Connection refused
App did not pick up! Please check app logs.
-----------------------------------STDOUT-----------------------------------
> node ./build.js
`linux-x64-v8-3.14` exists; testing
Binary is fine; exiting
ansi-regex#0.2.1 node_modules/ansi-regex
ansi-styles#1.1.0 node_modules/ansi-styles
escape-string-regexp#1.0.3 node_modules/escape-string-regexp
chalk#0.5.1 node_modules/chalk
strip-ansi#0.3.0 node_modules/strip-ansi
supports-color#0.2.0 node_modules/supports-color
has-ansi#0.1.0 node_modules/has-ansi
eachline#2.3.3 node_modules/eachline
type-of#2.0.1 node_modules/type-of
amdefine#1.0.0 node_modules/amdefine
asap#2.0.3 node_modules/asap
meteor-promise#0.4.8 node_modules/meteor-promise
underscore#1.5.2 node_modules/underscore
promise#7.0.4 node_modules/promise
source-map-support#0.3.2 node_modules/source-map-support
semver#4.1.0 node_modules/semver
source-map#0.1.32 node_modules/source-map
fibers#1.0.5 node_modules/fibers
Waiting for MongoDB to initialize. (5 minutes)
connected
AppName start/running, process 12612
Waiting for 15 seconds while app is booting up
Checking is app booted or not?
----------------------------------------------------------------------------
What's causing this?
How do I solve this?
Thank you....it's my first time using AWS EC2...
Make sure your mup.json nodeVersion is up to date with the Node version (0.10.40) required by the latest Meteor version (1.2).
"nodeVersion": "0.10.40",

Resources