using prisma on Windows 10. I need to generate prisma in an offline mode. No internet access in pipeline. My package.json as below;
{
"name": "hello-prisma",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"#types/node": "^17.0.13",
"prisma": "^3.8.1",
"ts-node": "^10.4.0",
"typescript": "^4.5.5"
}
}
and schema.prisma as follows;
generator client {
provider = "prisma-client-js"
engineType="binary"
binaryTargets=["native"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
.env file as follows;
DATABASE_URL=postgresql://postgres:postgres#localhost:5432/countrydb?schema=auth
PRISMA_CLI_QUERY_ENGINE_TYPE=binary
PRISMA_QUERY_ENGINE_BINARY=node_modules/#prisma/engines/query_engine-windows.dll
PRISMA_MIGRATION_ENGINE_BINARY=node_modules/#prisma/engines/migration-engine-windows.exe
PRISMA_INTROSPECTION_ENGINE_BINARY=node_modules/#prisma/engines/introspection-engine-windows.exe
PRISMA_FMT_BINARY=node_modules/#prisma/engines/prisma-fmt-windows.exe
DEBUG="*"
when I run npx prisma generate below JSON input error happens;
$ npx prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Error: Get config: SyntaxError: Unexpected end of JSON input
Environment & setup
OS: Windows
Database: PostgreSQL
Node.js version: v14.17.2
Prisma Version
prisma : 3.8.1
#prisma/client : 3.8.1
Current platform : windows
Related
I am trying to install bower according to the material provided by Microsoft for their azure extensions widgets sample (https://github.com/microsoft/vsts-extension-samples).
Here's what the bower.json looks like:
{
"name": "widgets",
"homepage": "https://github.com/Microsoft/vso-extension-samples",
"description": "",
"main": "",
"moduleType": [],
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"vss-web-extension-sdk": "^1.95.2"
}
}
However, despite whatever I've tried I'm unable to by-pass or proceed while getting the following local issuer certificate error:
bower vss-web-extension-sdk#^1.95.2UNABLE_TO_GET_ISSUER_CERT_LOCALLY Request to https://registry.bower.io/packages/vss-web-extension-sdk failed: unable to get local issuer certificate
I have an Express.js api that works locally, using Postgresql via Knex/SQL queries.
I am trying to deploy to Heroku, however, when I attempt to migrate the DB I get the error that Heroku can't find the migration files.
Specifically, when I run the migration it throws:
Using environment: production Error: ENOENT: no such file or
directory, scandir '/app/migrations'
My migrations are located at my_app/db/migrations. The app folder mentioned in the error does not exist. Trying to figure out how to point to the correct folder.
Here is my package.json:
{
"name": "writerboard-express-api",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"serve": "cross-env NODE_ENV=development nodemon server.js"
},
"keywords": [],
"author": "dariusgoore <dariusgoore#gmail.com> (dariusgoore.com)",
"license": "MIT",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^8.1.0",
"express": "^4.17.1",
"express-jwt": "^5.3.1",
"jsonwebtoken": "^8.5.1",
"knex": "^0.19.3",
"objection": "^1.6.9",
"objection-password": "^2.0.0",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"pg": "^7.12.1"
},
"devDependencies": {
"cross-env": "^5.2.1",
"nodemon": "^1.19.1"
}
}
My knexfile (myapp/knexfile.js):
const dotenv = require('dotenv');
dotenv.config({ path: "../.env" });
module.exports = {
development: {
client: 'postgresql',
connection: {
database: 'writerboard_dev', // update with env var
user: 'dariusgoore' // update with env var
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations',
directory: './db/migrations'
},
seeds: {
directory: './db/seeds'
}
},
production: {
client: 'postgresql',
connection: process.env.DATABASE_URL,
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
},
ssl: true
}
};
here is the server log from heroku:
2019-09-16T14:25:00.251226+00:00 heroku[web.1]: State changed from down to starting
2019-09-16T14:25:00.063523+00:00 app[api]: Release v8 created by user dariusgoore#gmail.com
2019-09-16T14:25:00.063523+00:00 app[api]: Deploy b697b243 by user dariusgoore#gmail.com
2019-09-16T14:25:00.000000+00:00 app[api]: Build succeeded
2019-09-16T14:25:03.700742+00:00 heroku[web.1]: Starting process with command `node server.js`
2019-09-16T14:25:08.369304+00:00 heroku[web.1]: State changed from starting to up
2019-09-16T14:25:07.885086+00:00 app[web.1]: Running on localhost:58146
FYI, the answer was in the knexfile.js. Needed to set the migrations directory for production.
I am getting the error:
Heroku push rejected failed to define node.js node not defined in package.json
My app works locally, this is an Express MongoDB using handlebars. My gitignore has node_modules in it and the strange part is I am using nodemon and not node.
package.json:
{
"name": "Jukebox",
"version": "1.1.0",
"engines": {
"node": "11.3.0",
"npm": "6.4.1"
},
"private": true,
"scripts": {
"start": "node ./bin/www",
"dev": "nodemon ./bin/www"
},
"dependencies": {
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"dotenv": "^6.1.0",
"express": "~4.16.0",
"hbs": "~4.0.1",
"http-errors": "~1.6.2",
"method-override": "^3.0.0",
"mongoose": "^5.3.6",
"morgan": "~1.9.0",
"nodemon": "^1.18.4"
},
"description": "Jukebox is an app where users can add their favorite songs for others to discover. There will be a maximum number of 32 songs that can be added. When user selects genre the artists of that genre will populate the grid and a button will appear to add artist.",
"main": "app.js",
"repository": {
"type": "git",
"url": "git+https://github.com/chuckderosier/Jukebox.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/chuckderosier/Jukebox/issues"
},
"homepage": "https://github.com/chuckderosier/Jukebox#readme"
}
You need to specify a Node.js version within your package.json that matches
the runtime you’re developing and testing with.
Do the following:
Within your cmd line type: node --version and see what version of Node you're developing with.
Add an engines section within your package.json specifying your node version from step 1. For example something similar to this:
"engines": {
"node": "10.3.0"
}
For more information checkout the Heroku documentation for Nodejs buildpacks
I get this error while trying to install the Mopa bootstrap bundle through command line:
"C:\ProgramData\ComposerSetup\bin\composer.bat" require
mopa/bootstrap-bundle ^3.0
Error:
installation failed reverting ./composer.json to its original content
mopa
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress]
[--no-suggest] [--no-update] [--no-scripts] [--update-no-dev]
[--update-with-dependencies] [--ignore-platform-reqs]
[--prefer-stable] [--prefer-lowest] [--sort-packages]
[-o|--optimize-autoloader] [-a|--classmap-authoritative]
[--apcu-autoloader] [--] []...
Im lost since I`m not getting any explanation of what failed.
So listen here, I have a solution for you. As I see that you are working with composer I'll teach you how to do it.
First you must change your "composer.json" file in your project, adding in "require" section:
"require": {
...
"mopa/bootstrap-bundle": "*",
"twbs/bootstrap": "*",
"knplabs/knp-menu-bundle": "*"
}
(NOTE: "knplabs/knp-menu-bundle": "*" is recommended to put as well when you use twbs).
And then add this repository in the json:
"repositories": [
{
"type": "package",
"package": {
"version": "2.2.1",
"name": "twitter/bootstrap",
"source": {
"url": "https://github.com/twitter/bootstrap.git",
"type": "git",
"reference": "master"
},
"dist": {
"url": "https://github.com/twitter/bootstrap/zipball/master",
"type": "zip"
}
}
}
]
Save and finally, you should execute your composer update(dev) command.
Hope it works!
On CentOS, dotnet restore aborts without an error:
dotnet --verbose restore
Telemetry is: Enabled
log : Restoring packages for /home/forexsb/testapp/project.json...
Aborted
Here is my environment info:
dotnet --info
.NET Command Line Tools (1.0.0-preview2-1-003177)
Product Information:
Version: 1.0.0-preview2-1-003177
Commit SHA-1 hash: a2df9c2576
Runtime Environment:
OS Name: centos
OS Version: 7
OS Platform: Linux
RID: centos.7-x64
This is my project.json content:
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
}
}
}
}
Any ideas how to fix it?