Yarn install loops itself - yarnpkg

I get yarn loops when starting my server.
>Console Listener setup OK
>Started map fivem-map-hipster
>Started resource fivem-map-hipster
>[yarn] yarn install v1.22.5
>[yarn] [1/4] Resolving packages...
and then it loops and tries to resolve the package again.
My package.json looks like this:
{
"name": "webpack-builder",
"version": "1.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"async": "^3.1.0",
"webpack": "^4.41.2",
"worker-farm": "^1.7.0"
}
}
what am I missing?

Related

while deploying my project to heroku i am getting error Cannot find module '/app/server.js'

As you can see the error but i have declared everything corrctly still i am getting this error. my server.js file is present inside the backend folder.
my package.json
{
"name": "mern",
"version": "1.0.0",
"description": "MERN Develeopment",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "nodemon backend/server.js",
"client": "npm start --prefix frontend",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix frontend"
},
"author": "Rahul Kumar",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"dotenv": "^16.0.1",
"express": "^4.18.1",
"express-async-handler": "^1.2.0",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.13.15",
"nodemon": "^2.0.19"
}
}
Procfile - web:node backend/server.js
anybody please help on this.

npm showing severity vulnerabilities Laravel in ubuntu 18.04 LTS

running command npm install laravel-mix cross-env --save-dev from web/themes/custom/cp_bootstrap4 directory npm showing severity vulnerabilities Laravel in ubuntu 18.04 LTS
added 744 packages from 474 contributors and audited 745 packages in 90.492s
found 1 moderate severity vulnerability
I have tried commands
1. npm audit fix
2. npm audit fix --force
but 1 severity vulnerabilities not solved.
Output of above command
npm audit security report
Manual Review
Some vulnerabilities require your attention to resolve
Moderate file-type vulnerable to Infinite Loop via malformed MKV file
Package file-type
Patched in >=16.5.4
Dependency of laravel-mix [dev]
Path laravel-mix > imagemin > file-type
my sub-theme package.json
{
"name": "cp_bootstrap4",
"version": "1.0.0",
"description": "[Bootstrap 4](https://www.drupal.org/project/bootstrap4) subtheme.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"cross-env": "^7.0.3",
"laravel-mix": "^6.0.49"
}
}
Please suggest me to resolve this issue!
Try adding to your package.json an override that means it will replace a package in your dependency tree with another version.
The package that has vulnerabilities is file-type, but npm says that you have to update the dependent-package (package>dependent-package>package-with-vulnerabilities), so you will have to update imagemin.
It seems that laravel-mix have not fix this issue, but the solution all ready exist.
Check this URL: https://snyk.io/test/npm/laravel-mix/6.0.20#SNYK-JS-FILETYPE-2958042
Try with this code on your package.json
{
"name": "cp_bootstrap4",
"version": "1.0.0",
"description": "[Bootstrap 4](https://www.drupal.org/project/bootstrap4) subtheme.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"cross-env": "^7.0.3",
"laravel-mix": "^6.0.49"
},
"overrides": {
"laravel-mix": {
"imagemin": "^8.0.1"
}
}
}

What is resaon for deploying package.json to heroku?

i'm trying to upload a javascript nodejs project to Heroku. Localhost works perfectly but when i try to upload it gives me a:
unable to parse error at :
The Error Message : Unmatched '}' at line 16, column 1
Full Json file:
{
"name": "reactbot",
"version": "1.0.0",
"description": "React bot for webpage",
"main": "index.js",
"engines": {
"node": "12.16.2",
"npm": "6.14.4"
},
"scripts": {
"start": "node index.js"
},
"author": "Ruhul",
"license": "ISC",
"dependencies": {
"express": "^4.17.1",
"nodemon": "^2.0.3"
}
}
The package.json file defines the dependencies that should be installed with your application.
Be sure to use the correct JSON format.
e.g.
{
"name": "node-example",
"version": "1.0.0",
"description": "This example is so cool.",
"main": "web.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"example",
"heroku"
],
"author": "jane-doe",
"license": "MIT",
"dependencies": {
"express": "^4.9.8"
},
"engines": {
"node": "10.x"
}
}

Hello this is my package.json file. But Heroku tells me Application error An error occurred in the application and your page could not be served

Hello this is my json file format and this works well on my local machine when I run node index.js.
{
"name": "a-simple-nodejs-website",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node index.js"
},
"author": "Theodore Kelechukwu Onyejiaku",
"license": "ISC"
}
But Heroku tells me:
Application error
An error occurred in the application and your page could not be served...
You need to mention engine in package.json as below
{
"name": "a-simple-nodejs-website",
"version": "1.0.0",
"description": "",
"main": "index.js",
"engines": {
"node": "10.x"
},
"scripts": {
"test": "node index.js"
},
"author": "Theodore Kelechukwu Onyejiaku",
"license": "ISC"
}
Check your Application Port in index.js. if you set to static port change as below:
const PORT = process.env.PORT || 5000
pass this port in your server listen method.
There was no start script in the json file so add => "start": "node index.js".
Fool code sample is below
{
"name": "a-simple-nodejs-website",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node index.js",
"start": "node index.js"
},
"author": "Theodore Kelechukwu Onyejiaku",
"license": "ISC"
}

Decoupled Deployment of Web App using Heroku, gh-pages, and MySQL

My team and I created a MERN stack application (M for MySQL) that is planning on hosting our client on gh-pages and our server on heroku. So far we have been unable to deploy because we keep getting errors about our use of the npm package concurrently. Although we can access our heroku url and our gh-pages url, we are unable to connect the two
We have already tried adding a proxy to our package.json within our client folder and have added a .env.development Host name (heroku url)
Root Directory
- client
- package.json
- package-lock.json
- config
- config.json
- passport.json
- controllers
- models
- routes
- .env
- .env.development
- .gitignore
- package-lock.json
- package.json
- server.js
Server package.json
{
"name": "traveler",
"version": "1.0.0",
"homepage": "http://dchicchon.github.io/Traveler",
"description": "A social media platform for people who love traveling and those who want to explore.",
"main": "server.js",
"scripts": {
"start": "if-env NODE_ENV=production && npm run start:prod || npm run start:dev",
"start:prod": "node server.js",
"start:dev": "concurrently \"nodemon --ignore 'client/*'\" \"npm run client\"",
"client": "cd client && npm run start",
"seed": "node scripts/seedDB.js",
"install": "cd client && npm install",
"build": "cd client && npm run build",
"heroku-postbuild": "npm run build"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"aws-sdk": "^2.511.0",
"bcryptjs": "^2.4.3",
"concurrently": "^4.1.1",
"dotenv": "^8.0.0",
"express": "^4.17.1",
"express-session": "^1.16.2",
"gh-pages": "^2.0.1",
"multer": "^1.4.2",
"multer-s3": "^2.9.0",
"mysql2": "^1.6.5",
"passport": "^0.4.0",
"passport-local": "^1.0.0",
"sequelize": "^5.13.1"
},
"devDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/dchicchon/Traveler.git"
},
"bugs": {
"url": "https://github.com/dchicchon/Traveler/issues"
}
}
Client package.json
{
"name": "traveler",
"version": "0.1.0",
"proxy": "https://travelersite.herokuapp.com/",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"google-map-react": "^1.1.4",
"lodash": "^4.17.15",
"materialize-css": "^1.0.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-router-dom": "^5.0.1",
"react-scripts": "3.1.0",
"styled-components": "^4.3.2"
},
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"gh-pages": "^2.1.1"
}
}
After entering the command heroku create and git push heroku master we would expect that our server will be pushed to heroku and our client will be deployed to gh-pages.
Does removing heroku-postbuild script from your backend package.json work?

Resources