Heroku push rejected failed: npm ERR! 404 Not Found: event-stream#3.3.6. This causes a build fail - mongodb

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

Related

UNABLE_TO_GET_ISSUER_CERT_LOCALLY while trying to install Bower

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

Sanity Deployment on Vercel Issue: Cannot find module 'sanity' even though package is installed

So i'm trying to deploy sanity/nextjs on vercel. It runs fine locally but for the production build I keep getting the same error.
Here's the main error:
> build
> next build
info - Linting and checking validity of types...
Failed to compile.
./sanity/sanity.config.ts:1:28
Type error: Cannot find module 'sanity' or its corresponding type declarations.
> 1 | import {defineConfig} from 'sanity'
| ^
2 | import {deskTool} from 'sanity/desk'
3 | import {visionTool} from '#sanity/vision'
4 | import {schemaTypes} from './schemas'
Error: Command "npm run build" exited with 1
My sanity package.json:
{
"name": "nft-drop",
"private": true,
"version": "1.0.0",
"main": "package.json",
"license": "UNLICENSED",
"scripts": {
"dev": "sanity dev",
"start": "sanity start",
"build": "sanity build",
"deploy": "sanity deploy",
"deploy-graphql": "sanity graphql deploy"
},
"keywords": [
"sanity"
],
"dependencies": {
"#sanity/vision": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
"sanity": "^3.0.0",
"styled-components": "^5.2.0"
},
"devDependencies": {
"#sanity/cli": "^3.2.3",
"#sanity/eslint-config-studio": "^2.0.1",
"eslint": "^8.6.0",
"prettier": "^2.8.3",
"typescript": "^4.0.0"
},
"prettier": {
"semi": false,
"printWidth": 100,
"bracketSpacing": false,
"singleQuote": true
}
}
My main folder package.json:
{
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"#next/font": "^13.1.2",
"#sanity/image-url": "^1.0.1",
"#thirdweb-dev/react": "^3.6.9",
"#thirdweb-dev/sdk": "^3.6.9",
"ethers": "^5.7.2",
"next": "latest",
"next-sanity": "^4.0.6",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"#sanity/cli": "^3.2.3",
"#types/node": "18.11.3",
"#types/react": "18.0.21",
"#types/react-dom": "18.0.6",
"autoprefixer": "^10.4.12",
"postcss": "^8.4.18",
"tailwindcss": "^3.2.4",
"typescript": "4.9.4"
}
}
Thanks for your help.
I've checked that I have the 'sanity' package installed. I've added the recommended 'vercel.json' file and I also have the #sanity/cli installed. I've checked my local env setup to make sure that was also on vercel.
Maybe i've overinstalled the sanity packages in trying to solve it?
This is my first time using sanity, nextjs, and vercel so I've run out of ideas and haven't found the same issue answered elsewhere yet.
I had this issue as well, and it seems to be related to Sanity v3 which only came out a month ago - I rolled back to sanity v2 and it fixed the deployment issue
You can try to add .vercelignore in the root file and add sanity in there to ignore the whole folder
The fix is to move your sanity client config file (aka wherever you have your .env variables setup - in my case: sanity.ts) into a lib folder in the root directory. If the file itself is in the root directory, it will not build.
Updating the import statement from
import {defineConfig} from 'sanity'
to
import {defineConfig} from 'sanity/lib/exports'
worked for me.

Parse error Unexpected token '�' at 1:1 ��{ on flutter app when running firebase deploy

encounter the below message when trying to firebase deploy from root project
Error: Parse Error in ...\firestore.indexes.json
Unexpected token '�' at 1:1
��{
I have a flutter app, upon which I also have a functions folder. Below is the file position:
AppFolder
functions
.eslintrc.js
index.js
package.json
etc
lib
files relative to flutter app
test
test files relative to flutter app
web firestore.indexes.json
firebase.json
etc
I am running on windows 11 in a newly built pc (so maybe sth is missing?), other devs are running on mac, I have changed the EOF sequence to LF on the 3 files of the functions folder, I have also run these two commands inside the functions folder
npm install firebase-functions#latest firebase-admin#latest --save
npm install -g firebase-tools
npm version is 8.1.2
node version is v16.13.1
firestore.indexes.json is:
{
"indexes": [
{
"collectionGroup": "something1",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "created",
"order": "DESCENDING"
},
{
"fieldPath": "something2",
"order": "DESCENDING"
}
]
},
{
"collectionGroup": "something3",
"queryScope": "COLLECTION",
"fields": [
{
"fieldPath": "something4",
"order": "ASCENDING"
},
{
"fieldPath": "something5",
"order": "DESCENDING"
}
]
}
],
"fieldOverrides": []
}
.elslint.js is
module.exports = {
"root": true,
"env": {
es6: true,
node: true,
},
"extends": [
"eslint:recommended",
"google",
],
"rules": {
quotes: ["error", "double"],
},
"parserOptions": {
"ecmaVersion": 2020,
},
};
and package.json is
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "14"
},
"main": "index.js",
"dependencies": {
"axios": "^0.24.0",
"device-detector-js": "^3.0.0",
"firebase": "^9.2.0",
"firebase-admin": "^10.0.1",
"firebase-functions": "^3.16.0"
},
"devDependencies": {
"eslint": "^8.1.0",
"eslint-config-google": "^0.14.0",
"firebase-functions-test": "^0.3.3"
},
"private": true
}
Please keep in mind that in an older pc running windows 10 and I can deploy by changing only to the LF and running the above commands.
Just try to make a new text file and copy the content of generated file inside the new one. Then override the new file with firestore.indexes.json
Its obvious that the generated json file has some formatting problem.
I recently had this problem and found that it was resolved by changes to the firebase.json file:
Seek "predeploy":
Delete the code so that the outcome is "predeploy": []
After this, run the firebase deploy function again, and everything should be fine.
Thank you to Max for sharing this solution with me : )

Sails.js datastore fails after some time

I have configured my dummy Sails.js application to work with mysql database like so:
module.exports.datastores = {
default: {
adapter: require('sails-mysql'),
url: 'mysql://mysql:mysql#localhost:3306/sails',
}
};
and it works fine, both read and write operations work great. However, after some time http requests begin to fail with 500 code and the error is:
AdapterError: Unexpected error from database adapter: Could not run
select() because of 2 problems:
• "datastore" is required, but it was not defined.
• "models" is required, but it was not defined.
While this is happening, I keep getting this error with every page refresh. If I kill the server and lift it again, the database works fine for some time. I couldn't find much on this error online. Not sure where to look for the solution.
Below is my package.json just in case
{
"name": "ration",
"private": true,
"version": "0.0.0",
"description": "a Sails application",
"keywords": [],
"dependencies": {
"#sailshq/connect-redis": "^3.2.1",
"#sailshq/lodash": "^3.10.3",
"#sailshq/socket.io-redis": "^5.2.0",
"sails": "^1.5.0",
"sails-hook-apianalytics": "^2.0.3",
"sails-hook-autoreload": "^1.1.0",
"sails-hook-organics": "^2.0.0",
"sails-hook-orm": "^4.0.0",
"sails-hook-sockets": "^2.0.0",
"sails-mysql": "2.0.0"
},
"devDependencies": {
"eslint": "5.16.0",
"grunt": "1.0.4",
"htmlhint": "0.11.0",
"lesshint": "6.3.6",
"sails-hook-grunt": "^5.0.0"
},
"scripts": {...},
"main": "app.js",
"repository": {
"type": "git",
"url": "git://github.com/anonymous node/sails user/ration.git"
},
"author": "anonymous node/sails user",
"license": "",
"engines": {
"node": "^16.13"
}
}
Turned out this problem was caused sails-hook-autoreload and I'm a bit ashamed I did not notice the pattern that causes this error every time the hook was triggered. I ended up using nodemon for automated server restarts and everything works fine. Hope this will help somebody out there.

Composer create-project always fails with the project I created

I have this project on Github and Packagist:
https://github.com/gitraffa/framework
https://packagist.org/packages/gitraffa/framework
I want to use this as a deploy app, so, when I need to start a new project I just go to the cmd and type composer create-project gitraffa/framework --prefer-distand it should automatically create the folder and inser the files. But it isn't working(I always get something saying that a stable version could not be found). Am I doing something wrong or can't this be done?
Here is my composer.json file:
{
"name": "gitraffa/framework",
"description": "A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!",
"homepage": "http://rafaelmsantos.com/",
"license": "GPL-3.0",
"authors": [
{
"name": "Rafael Santos",
"email": "dev.rafael#mail.com",
"homepage": "http://rafaelmsantos.com"
}
],
"require": {
"php": ">=5.3.6",
"psr/log": "~1.0"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/gitraffa/framework"
}
],
"extra": {
"branch-alias": {
"dev-master": "1.0.0"
}
}
}
Composer by default installs only tagged versions (last stable that meets condition).
The error message can be fixed by:
using #dev tag, like: composer create-project gitraffa/framework:#dev --prefer-dist
tagging your package