I keep getting a postgrator-cli error on heroku npm deploy - postgresql

I'm trying to deploy an app to heroku but for some reason when I run the deploy command I keep on getting this error:
rator-cli\postgrator-cli.js:143
rl.history = rl.history.slice(1);
^
TypeError: Cannot read property 'slice' of undefined
at C:\Users\Zackr\Documents\node\noteful-exercise\noteful-server\node_modules\postgrator-cli\postgrator-cli.js:143:33
at Interface._onLine (readline.js:327:5)
at Interface._normalWrite (readline.js:474:12)
at Socket.ondata (readline.js:186:10)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! noteful-server#1.0.0 migrate: `postgrator --config postgrator-config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the noteful-server#1.0.0 migrate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Zackr\AppData\Roaming\npm-cache\_logs\2021-01-04T22_04_36_447Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! noteful-server#1.0.0 migrate:production: `env SSL=true DATABASE_URL=$postgres://rwdhntkhuroptu:48522106b9f5aaf0890905df7abe67c75710e00aba50b80edcf01a07d5cbe918#ec2-52-203-49-58.compute-1.amazonaws.com:5432/dcgq78oje0lmb6 npm run migrate`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the noteful-server#1.0.0 migrate:production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Zackr\AppData\Roaming\npm-cache\_logs\2021-01-04T22_04_36_547Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! noteful-server#1.0.0 postdeploy: `npm run migrate:production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the noteful-server#1.0.0 postdeploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Zackr\AppData\Roaming\npm-cache\_logs\2021-01-04T22_04_36_614Z-debug.log
The scripts for my package.json is:
"scripts": {
"test": "mocha --require test/setup.js",
"dev": "nodemon src/server.js",
"migrate": "postgrator --config postgrator-config.js",
"migrate:test": "env NODE_ENV=test npm run migrate",
"migrate:production": "env SSL=true DATABASE_URL=$(heroku config:get DATABASE_URL) npm run migrate",
"start": "node src/server.js",
"predeploy": "npm audit && npm run migrate:production",
"deploy": "git push heroku main"
},
I have the connection string and url for the database and the normal migration worked until I changed the url to the heroku URL instead of my local host server.

Node.js 6 was end-of-lifed in April 2018. It has known security vulnerabilities and most libraries don't support it. Update to at least Node.js 10.x, and preferably 14.x.
Current version of postgrator-cli is 4.0.0 and it explicitly doesn't support Node.js prior to 10.x. The last version of postgrator-cli to support Node.js 6.x was postgrator-cli 3.2.0, published in September 2019. So if you cannot upgrade Node.js, another option is to downgrade postgrator-cli to 3.2.0.

Related

Ionic Capcitor build Android unable to resolve dependency tree

I am receiving an error when attempting to run ionic capacitor build android (details below):
PS C:\Users\User\source\repos\imango\src> ionic capacitor build android
npm.cmd i -E #capacitor/android#latest
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: mango#0.0.1
npm ERR! Found: #capacitor/core#3.7.0
npm ERR! node_modules/#capacitor/core
npm ERR! #capacitor/core#"^3.5.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #capacitor/core#"^4.0.0" from #capacitor/android#4.0.1
npm ERR! node_modules/#capacitor/android
npm ERR! #capacitor/android#"4.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\User\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Local\npm-cache_logs\2022-08-06T22_53_19_523Z-debug-0.log
[ERROR] An error occurred while running subprocess npm.
npm.cmd i -E #capacitor/android#latest exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Your capacitor cli version is still set at 3.6.0 in your
devDependencies, try changing that to ^4.0.1 and clearing your
node_modules and removing your package-lock.json and run npm install
again.
Check this
Copied from her:
https://github.com/ionic-team/capacitor/issues/5812

Issues running Ionic on Macbook

I have been having issues running ionic on my MacBook. I have npm and node downloaded yet my system still doesn't seem to allow me to get Ionic to run. I have tried running it with the sudo command too.
When I run the command npm install -g ionic I get:
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/ionic
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ionic'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/ionic'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/ionic'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Janelle/.npm/_logs/2022-03-27T18_13_54_411Z-debug-0.log
looks like ionic was not installed correctly initially, you can always try and remove ionic and re-install. You should not have to run it with sudo

vscode.d.ts could not be installed

when I tried to run vscode-install, it would fail to sync vscode.d.ts. The problem seems random, most of our machines could not success, but two of our machines could success.
The error information is as follows:
Detected VS Code engine version: ^1.23.0
Error installing vscode.d.ts: Error: read ECONNRESET
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lispvsext#0.0.1 postinstall: `vscode-install && node ./node_modules/vscode/bin/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lispvsext#0.0.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\*\AppData\Roaming\npm-cache\_logs\2019-02-15T09_28_45_624Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lispvsext#1.0.8 postinstall: `cd extension && npm install && cd ..`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lispvsext#1.0.8 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\*\AppData\Roaming\npm-cache\_logs\2019-02-15T09_28_45_805Z-debug.log
I had a similar problem, where the VSCode engine in package.json was very old (1.32.0) compared to the current VSCode version (1.64.2). I just updated the engine to the same as my VSCode version in package.json:
"engines": {
"vscode": "^1.64.2"
},
and the tests runner proceeds instead of erroring as before.
Unfortunately, I then got another error:
Error: Running extension tests from the command line is currently only supported if no other instance of Code is running.
which is a different problem and a limitation of VSCode at the moment (1.64.2), though there is a workaround for that.

Trying to deploy IBM Watson NLC in Bluemix and get Error: EACCES, mkdir '/opt/IBM/node/share/man/man3' error (every time)

I have created the IBM Watson Natural Language Processor service and I'm trying to deploy the training application. It creates the project, clones the repository, and configures the pipeline, but gets an error during the 'Deploy to Bluemix' step.
The error is:
Cloning the 'master' branch from repo 'https://P90MSG01:3041/git/esilky/ibmwatson-nlc-groundtruth-esilky-952'
/opt/IBM/node/bin/npm -> /opt/IBM/node/lib/node_modules/npm/bin/npm-cli.js
npm ERR! Error: EACCES, mkdir '/opt/IBM/node/share/man/man3'
npm ERR! { [Error: EACCES, mkdir '/opt/IBM/node/share/man/man3']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/opt/IBM/node/share/man/man3' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.13.0-52-generic
npm ERR! command "/opt/IBM/node/bin/node" "/opt/IBM/node/bin/npm" "install" "npm#2.14.4" "-g"
npm ERR! cwd /home/pipeline/6abb55b0-7254-4bc1-8d74-aa4550db9b1b
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /opt/IBM/node/share/man/man3
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/opt/IBM/node/share/man/man3'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pipeline/6abb55b0-7254-4bc1-8d74-aa4550db9b1b/npm-debug.log
npm ERR! not ok code 0
Finished: ERRORED
What needs to be done to resolve this?
Looks like your question was already answered here.
According to Patrick Wagstrom, the problem was fixed in December 7, 2015
If you try to deploy the NLC toolkit today it will work.
NLC Toolkit: https://hub.jazz.net/project/wdctools/ibmwatson-nlc-groundtruth/overview

Npm install directly from Github Error: ENOENT

I'm running an example from build-nodejs-npm-installation-package-scratch. Instead of uploading to npm repository I'm putting it on Github and trying to download it via npm instead. I run npm install git+https://github.com/t2wu/replaceme.git and got the following:
npm ERR! Error: ENOENT, chmod '/private/tmp/node_modules/replaceme_tim/replaceme.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "git+https://github.com/t2wu/replaceme.git"
npm ERR! cwd /private/tmp
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! path /private/tmp/node_modules/replaceme_tim/replaceme.js
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/tmp/npm-debug.log
npm ERR! not ok code 0
I have a package.json in there, I cannot figure out what is wrong.
EDIT: I can install Express OK, but I can't install my practice module
This happens due to missing permissions or unlinked files while npm was working. This topicc is also seen at github, here.
Try running with admin perms.