why "jitsu deploy" got "Error: Cannot find module 'browserid-verifier'"? - node.js

Seems only a module's missing, but I've wrote the in the package.jsonfile, and others seems fine.
I've debugged this little app locally many times, there is a version of browserid module here...
The browserid-verifier module can be found here:
https://github.com/lloyd/node-browserid
and, `package.jsonq file:
{
"name": "daily_bookmarks",
"subdomain": "daily_bookmarks",
"scripts": {
"start": "server.coffee"
},
"version": "0.0.0-9",
"engines": {
"node": "0.6.x"
},
"main": "server.js",
"dependencies": {
"mongodb": "0.9.9",
"socket.io": "0.9.3",
"ezcrypto": "0.0.3",
"browserid-verifier": "0.0.4"
}
}
the version on my laptop:
$ npm list -g | grep browser
├─┬ browserid-verifier#0.0.4
│ ├─┬ browserify#1.8.1
ERROR:
$ jitsu deploy
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in server.coffee
warn: Local version appears to be old.
warn: Your package.json version will be incremented for you automatically.
warn: About to write /home/chen/code/home/git/docview/projects/daily_bookmarks/package.json
data:
data: {
data: engines: { node: '0.6.x' },
data: dependencies: {
data: socket.io: '0.9.3',
data: browserid-verifier: '0.0.4',
data: mongodb: '0.9.9',
data: ezcrypto: '0.0.3'
data: },
data: subdomain: 'daily_bookmarks',
data: version: '0.0.0-9',
data: name: 'daily_bookmarks',
data: main: 'server.js',
data: scripts: { start: 'server.coffee' }
data: }
data:
prompt: Is this ok? (yes):
warn: Creating new snapshot for version 0.0.0-9
info: Done creating snapshot 0.0.0-9
info: Updating application daily_bookmarks
info: Activating snapshot 0.0.0-9 for daily_bookmarks
info: Stopping app daily_bookmarks
info: App daily_bookmarks is now stopped
info: Starting app daily_bookmarks
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
info: Nodejitsu not ok

npm ERR! error installing jwcrypto#0.1.1
npm ERR! error installing browserid-verifier#0.0.4
npm ERR! ...SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:683:
This is what I got while I was trying to install browserid-verifier locally. It seems that there is some problem while trying to npm install it. You can bundle it in your app.
"bundleDependencies": [
"browserid-verifier"
]

Related

Errors deploying node elastic beanstalk application

When deploying my new elastic beanstalk, Node.js 12 running on 64bit Amazon Linux 2/5.2.2, application, I'm getting error after running $ eb deploy myapp-staging-env:
2020-10-17 19:57:56 INFO Environment update is starting.
2020-10-17 19:58:22 INFO Deploying new version to instance(s).
2020-10-17 19:58:49 ERROR Instance deployment failed. For details, see 'eb-engine.log'.
2020-10-17 19:58:49 ERROR [Instance: i-034b2f1000000] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error..
2020-10-17 19:58:49 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-10-17 19:58:49 ERROR Unsuccessful command execution on instance id(s) 'i-034b2f1d46f466259'. Aborting the operation.
2020-10-17 19:58:50 ERROR Failed to deploy application.
I don't really know where to start.
Errors from logs:
Web.stdout.log: where do I go to fix this error?
----------------------------------------
/var/log/web.stdout.log
----------------------------------------
Oct 17 17:31:43 ip-172-31-47-6 web: Server running at http://127.0.0.1:8080/
...
Oct 17 19:58:50 ip-172-31-47-6 web: /bin/sh: -c: line 0: syntax error near unexpected token `('
Oct 17 19:58:50 ip-172-31-47-6 web: /bin/sh: -c: line 0: `node app.js%!(EXTRA string=server.js)'
Engine execution has encountered an error: what does this mean?
2020/10/17 19:58:49.360716 [INFO] Executing cleanup logic
2020/10/17 19:58:49.360804 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1602964729,"severity":"ERROR"}]}]}
2020/10/17 19:58:49.360984 [INFO] Platform Engine finished execution on command: app-deploy
Execution error on command [app-deploy]: where do I go to fix this?
2020/10/17 19:58:49.339070 [INFO] Running command /bin/sh -c systemctl start web.service
2020/10/17 19:58:49.360702 [ERROR] An error occurred during execution of command [app-deploy] - [FlipApplication]. Stop running the command. Error: Register application failed because the registration of proc web failed:
startProcess Failure: starting process "web" failed: Command /bin/sh -c systemctl start web.service failed with error exit status 1. Stderr:Job for web.service failed because the control process exited with error code. See "systemctl status web.service" and "journalctl -xe" for details.
My package.json:
{
"name": "api",
"version": "0.0.0",
"private": true,
"engines": {
"node" : "12.18.0"
},
"scripts": {
"initialize": "knex migrate:latest && knex seed:run",
"reset": "node_modules/.bin/knex migrate:rollback && node_modules/.bin/knex migrate:latest && node_modules/.bin/knex seed:run",
"initialize-prod": "node_modules/.bin/knex migrate:latest --env production && node_modules/.bin/knex seed:run --env production",
"reset-prod": "node_modules/.bin/knex migrate:rollback --env production && node_modules/.bin/knex migrate:latest --env production && node_modules/.bin/knex seed:run --env production",
"start": "node -v && node server.js",
"server": "node -v && nodemon server.js",
"server-debug": "nodemon --inspect=0.0.0.0 server.js",
"test": "mocha"
},
"dependencies": {
"#google-cloud/speech": "^3.5.4",
"#google-cloud/translate": "^5.1.4",
"body-parser": "^1.18.3",
"bookshelf": "^0.13.3",
"cookie-parser": "~1.4.3",
"cors": "^2.8.4",
"debug": "~2.6.9",
"dotenv": "^7.0.0",
"ejs": "~2.5.7",
"event-stream": "^3.3.5",
"express": "~4.16.0",
"fs": "0.0.1-security",
"fs-path": "0.0.24",
"knex": "^0.20.8",
"lodash": "^4.17.15",
"mailgun-js": "^0.22.0",
"moment": "^2.22.2",
"morgan": "^1.9.1",
"nock": "^10.0.6",
"node-gyp": "^7.1.2",
"passport": "^0.4.0",
"passport-cookie": "^1.0.6",
"pg": "^7.5.0",
"request": "^2.88.0",
"request-promise": "^4.2.2",
"swagger-jsdoc": "^4.0.0",
"swagger-ui-express": "^4.1.4"
},
"devDependencies": {
"chai": "^4.2.0",
"mocha": "^6.2.0",
"nodemon": "^1.18.4"
}
}
Also, for a previous node app I launched (last year), I was able to modify gzip compression and specify the node command, but this option is no longer available:
Elastic Beanstalk removed NodeCommand from software config in favor of a Procfile.
From updated AWS docs on EB Node Deployment:
You can add a Procfile to your source bundle to specify the command
that starts your application, as the following example shows. This
feature replaces the legacy NodeCommand option in the
aws:elasticbeanstalk:container:nodejs namespace.
The Procfile is added to the application root and contains your app run script, e.g.:
web: node server.js
I redeployed and it solved the deploy error (unsure about the Web.stdout.log and app-deploy errors above).

Getting Execution failed for task ':buildJsApps' error when building Spartacus storefront code in the cloud

I have successfully created the spartacus store in my local using npm and angular cli. When I moved the same to our cloud, I am getting the below error while building the application:-
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':buildJsApps'.
Process 'command 'yarn'' finished with non-zero exit value 1
If it's similar to what we've experienced, it might be related to dependencies.
If the error says something about babel, it was raised here: https://spartacus-storefront.slack.com/archives/CD16V16FR/p1584744427389300 The fix was to change the version of the dependency:
...
"devDependencies": {
"#babel/compat-data": "7.8.0",
"#babel/preset-env": "7.8.0",
"babel-loader": "8.1.0",
...
},
...
"resolutions": {
"#babel/preset-env": "7.8.0"
}
If not, it could be related to the Angular version, where the latest 8.x causes the error, and the fix may be to downgrade:
"devDependencies": {
"#angular-devkit/build-angular": "0.803.25",
"#angular/cli": "8.3.25"

Electron and couchbase: the module was compiled against a different node.js version (win)

Question:
I am trying to use couchbase in an electron application, but fail to run the electron application as soon as I include the couchbase module. How can I use couchbase with electron?
Error message:
C:\dev\app>npm start
> eej#1.0.0 start C:\dev\app
> electron .
App threw an error during load
Error: The module '\\?\C:\dev\app\node_modules\couchbase\build\Release\couchbase_impl.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 76. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at process.func (electron/js2c/asar.js:140:31)
at process.func [as dlopen] (electron/js2c/asar.js:140:31)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1016:18)
at Object.func (electron/js2c/asar.js:140:31)
at Object.func [as .node] (electron/js2c/asar.js:140:31)
at Module.load (internal/modules/cjs/loader.js:816:32)
at Module._load (internal/modules/cjs/loader.js:728:14)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at Module.require (internal/modules/cjs/loader.js:853:19)
My main.js file begins like this:
const { app, BrowserWindow } = require('electron')
var couchbase = require('couchbase');
function createWindow () {
What I have tried already:
removing the node_modules directory and lock file and reinstalling via npm i
installing and running electron-rebuild
using the --update-binary switch when running npm i
downgraded the npm version to an LTS version
Background information:
Node version:
PS C:\dev\app> node --version
v12.16.1
PS C:\dev\app> electron --version
v8.0.1
Electron uses node 12.13.0:
We are using node 12.13.0, Chrome 80.0.3987.86, and Electron 8.0.1.
The version of electron-node and standalone node differ. I am not sure if this is okay?!
Content of my package.json file:
{
"name": "app",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"author": "",
"license": "ISC",
"devDependencies": {
"couchbase": "^3.0.0",
"electron": "^8.0.1",
"electron-rebuild": "^1.10.0"
},
"dependencies": {
"node-gyp": "^6.1.0"
}
}
Similar questions:
Couchbase Node compiled against different node version: After I have added a comment I discovered that it is a unix specific question.
Node - was compiled against a different Node.js version using NODE_MODULE_VERSION 51: I went through nearly all of the suggestions, but none of them seemed to work for me.

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.

hubot-slack throwing an error on startup

I am trying to add a new hubot integration to our Slack channels. I am setting this up on a Windows machine and am deploying to a Heroku server. I followed the installation instructions provided here: https://github.com/slackhq/hubot-slack
I can create and run a new hubot instance on my local computer (calling "bin/hubot" in a Powershell prompt), but when I install the hubot-slack package and add "hubot-slack" to the external-scripts file I get an error. If I remove the value from the external-scripts file everything is fine.
PS C:\hubot> bin/hubot
jarvis> [Tue Dec 22 2015 15:18:24 GMT-0800 (Pacific Standard Time)] ERROR Error loading scripts from npm package - TypeError: require(...) is not a function
at Robot.loadExternalScripts (C:\hubot\node_modules\hubot\src\robot.coffee:399:11)
at C:\hubot\node_modules\hubot\bin\hubot:128:26
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
If I include the adapter flag for Slack I get a different error. I tried setting HUBOT_SLACK_TOKEN as a System Environment variable.
PS C:\hubot> bin/hubot -a slack
[Tue Dec 22 2015 15:21:54 GMT-0800 (Pacific Standard Time)] ERROR No services token provided to Hubot
Every example I can find is including the HUBOT_SLACK_TOKEN in the call to hubot, but it doesn't work for me (I must be missing something).
PS C:\hubot> HUBOT_SLACK_TOKEN=xoxb-22211110000-123456781234ZZZZYYYYXXXX ./bin/hubot --adapter slack
HUBOT_SLACK_TOKEN=xoxb-17240119159-dBeAEc2X8M2O9vJBYzWj5KFW : The term
'HUBOT_SLACK_TOKEN=xoxb-17240119159-dBeAEc2X8M2O9vJBYzWj5KFW' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ HUBOT_SLACK_TOKEN=xoxb-22211110000-123456781234ZZZZYYYYXXXX ./bin/hubot --adapte ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (HUBOT_SLACK_TOK...234ZZZZYYYYXXXX:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
To rule out something locally I deployed the application to Heroku, but I got a different error.
2015-12-22T22:28:49.426496+00:00 heroku[web.1]: State changed from crashed to starting
2015-12-22T22:14:54.739959+00:00 heroku[web.1]: State changed from starting to up
2015-12-22T22:14:55.133113+00:00 app[web.1]: [Tue Dec 22 2015 22:14:55 GMT+0000 (UTC)] ERROR Error loading scripts from npm package - TypeError: object is not a function
2015-12-22T22:14:55.133117+00:00 app[web.1]: at Robot.loadExternalScripts (/app/node_modules/hubot/src/robot.coffee:399:11, <js>:269:39)
2015-12-22T22:14:55.133119+00:00 app[web.1]: at fs.js:272:14
2015-12-22T22:14:55.133121+00:00 app[web.1]: at Object.oncomplete (fs.js:108:15)
2015-12-22T22:14:56.115333+00:00 heroku[web.1]: State changed from up to crashed
package.json:
{
"name": "jarvis",
"version": "0.0.0",
"private": true,
"author": "Me <email#domain.com>",
"description": "A friendly robot",
"dependencies": {
"hubot": "^2.17.0",
"hubot-diagnostics": "0.0.1",
"hubot-google-images": "^0.2.6",
"hubot-google-translate": "^0.2.0",
"hubot-help": "^0.1.2",
"hubot-heroku-keepalive": "^1.0.1",
"hubot-maps": "0.0.2",
"hubot-pugme": "^0.1.0",
"hubot-redis-brain": "0.0.3",
"hubot-rules": "^0.1.1",
"hubot-scripts": "^2.16.2",
"hubot-shipit": "^0.2.0",
"requirejs": "^2.1.22",
"hubot-slack": "^3.4.2"
},
"engines": {
"node": "0.10.x"
}
}
external-scripts.json
[
"hubot-diagnostics",
"hubot-help",
"hubot-heroku-keepalive",
"hubot-google-images",
"hubot-google-translate",
"hubot-pugme",
"hubot-maps",
"hubot-redis-brain",
"hubot-rules",
"hubot-shipit",
"requirejs",
"hubot-slack"
]
On Windows, it seems that the mechanism is a little different from what it processes in Linux. The error 'HUBOT_SLACK_TOKEN is not recognized' is raised because it would read the value of 'HUBOT_SLACK_TOKEN' from environment variables in windows.
Create an environment variable 'HUBOT_SLACK_TOKEN' manually and set the value, it will work.
You could check it out in the source code in the github repo: slack.coffee.
options =
token: process.env.HUBOT_SLACK_TOKEN
autoReconnect: !exitProcessOnDisconnect
autoMark: true
exitOnDisconnect: exitProcessOnDisconnect
proxyUrl: process.env.https_proxy
What intrigues me is this particular line:
Error loading scripts from npm package - TypeError: require(...) is not a function
Did you add the other scripts from the repo aswell?
There also might be something wrong with the node/npm/coffee installation/version on your windows machine. Make sure that those are installed and in a compatible version. Another thread had an issue with incompatible versions. Please tell us about the versions you use and try downgrading node to 0.12.x.
The way you use the token is fine.

Resources