Travis displaying build error when build was passed - mocha.js

travis badge fails to show build status is passing
i have tried copying the readme badge to show my build status but still keeps on showing build error on my repository
my test scripts
"scripts": {
"start": "node ./build/app.js",
"test": "npm run db:unmigrate && npm run db:migrate && npm run db:seedAll && npm run testing",
"dev": "nodemon --exec babel-node app/app.js",
"db:migrate": "babel-node app/server/migrations/migrate.js",
"db:unmigrate": "babel-node app/server/migrations/unmigrate.js",
"db:seedAll": "babel-node app/server/seed/seedAll.js",
"testing": "nyc mocha --timeout 50000 -r esm --exit",
"clean": "rm -rf build && mkdir build",
"build": "npm run clean && npm run build-babel",
"build-babel": "babel -d ./build ./app -s",
"generate-lcov": "nyc report --reporter=text-lcov > lcov.info",
"codeclimate-coverage": "codeclimate-test-reporter < lcov.info",
"coveralls-coverage": "coveralls < lcov.info",
"coverage": "npm run test && npm run generate-lcov && npm run coveralls-coverage && npm run codeclimate-coverage"
},
my test are run on a npm run test command my travis.yml file is below am using elephant sql
language: node_js
node_js:
- "stable"
install: npm install
cache:
directories:
- "node_modules"
env:
- CODECLIMATE_REPO_TOKEN=be3fcca4d68c6d7f19c1ca6ba76517d6c01e6891b3
- NODE_ENV=TEST
- SECRET_KEY=nagasaki
after_success:
- npm run coverage

i solved it by copying my travis badge into my readme.md from the travis build and pushing readme changes to my remote repository on github

Related

del -rf ../public/{js,css,img} && vue-cli-service build --no-clean | Parameter format not correct - "public"

I am using vue in laravel. npm run watch is working fine to me, But when I am creating a build out of it, it throwing me the following error.
> frontend#0.1.0 build C:\wamp64\www\laravel-vue\laravel-vue-cli-3\frontend
> del -rf ../public/{js,css,img} && vue-cli-service build --no-clean
Parameter format not correct - "public".
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend#0.1.0 build: `del -rf ../public/{js,css,img} && vue-cli-service build --no-clean`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend#0.1.0 build 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\2020-12-18T12_40_47_194Z-debug.log
This is my package.json file
{
"name": "frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "del -rf ../public/{js,css,img} && vue-cli-service build --no-clean",
"lint": "vue-cli-service lint"
},
}

how can I run "npm install && npm run dev on laravel 7?

i got this error when run command "npm install && npm run dev" on my project.
I have tried to run the command "npm install" and i get the other error.
enter image description here
You have to run:
npm install; npm run dev
The && operation in CLI only works in CMD on Windows. In Powershell you have to use a semicolon instead.
First try to update your nodejs version
npm install -g node
And then install cross-env globally
npm install --global cross-env
Finally install latest autoprefixer or 9.8.0 and run dev
npm install autoprefixer#9.8.0
npm install && run dev
The error you are getting is due to && operation in CLI, first of all, you have to install all dependencies using npm install and then you are allowed to run dev mode.
For real-time compiling you can use npm run watch instead of npm run dev.
Make sure you have installed node.js within your pc.

Running Vapor from Homestead failds

I installed Vapor in a brand new Laravel up. When I try to run 'vapor deploy production' I get this error:
Running Command: npm ci && npm run prod && rm -rf node_modules
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm#5 or later to generate it, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-10-23T21_24_09_128Z-debug.log
In Process.php line 254:
The command "npm ci && npm run prod && rm -rf node_modules" failed.
Exit Code: 1(General error)
Working directory: /home/vagrant/code/sales2/.vapor/build/app
Output:
================
Error Output:
================
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVers
ion >= 1. Run an install with npm#5 or later to generate it, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vagrant/.npm/_logs/2019-10-23T21_24_09_128Z-debug.log
I sucessfully installed vapor. Created a new project and left the domain setting at default.
You didn't specify what your host operating system was, but I assume it's windows, when you ran "vagrant up" did you do so as administrator?
That said, this is an issue with npm and not Vapor. I'd running the "npm ci && npm run prod && rm -rf node_modules" command ssh'd into your vagrant console and troubleshoot from there.
You may not have configured the node package manager for this project. From your computer and not the homestead if you are using, run this command
<project directory>: npm install
This will create the necessary file.

Can't find package.json in directory in CircleCI build

I have a repo that contains two subprojects. Just for completeness a frontend project and a firebase cloud-function project (both using separate package.jsons). Now for this project, I want to start two jobs concurrently. But I can't get the setup done with CircleCI. I don't have any cache-configuration.
project structure
-creepy-stories
-.circleci
-cloud-functions
-functions
package.json
-frontend
package.json
config.yml
version: 2.1
jobs:
cloud-functions:
docker:
- image: circleci/node:10.8.0
working_directory: ~/creepy-stories/cloud-functions/functions
steps:
- checkout
- run: npm install
- run: npm run lint
- run: npm run build
frontend:
docker:
- image: circleci/node:10.8.0
working_directory: ~/creepy-stories/frontend
steps:
- checkout
- run: npm install
- run: npm run lint
- run: npm run build
- run: npm run test:coverage
workflows:
version: 2
cloud-functions_and_frontend:
jobs:
- cloud-functions
- frontend
So now my I guess my problem is the environment cant find my package.json file. The error that is printed looks as follows:
npm run lint
#!/bin/bash -eo pipefail
npm run lint
npm ERR! path /home/circleci/creepy-stories/frontend/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/circleci/creepy-stories/frontend/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/circleci/.npm/_logs/2019-04-20T13_08_45_252Z-debug.log
Exited with code 254
I don't know if it is right to set the working directory twice in my configuration, but it is at least set in two diff. jobs.
Update
I managed to get it work if I checkout the root of the Project and then cd to the needed folder and execute the scripts. But this isn't really DRY (don't repeat yourself) maybe some of you have a better solution:
version: 2.1
jobs:
cloud-functions:
docker:
- image: circleci/node:10.8.0
working_directory: ~/creepy-stories
steps:
- checkout
- run: cd cloud-functions/functions && npm install
- run: cd cloud-functions/functions && npm run lint
- run: cd cloud-functions/functions && npm run build
web:
docker:
- image: circleci/node:10.8.0
working_directory: ~/creepy-stories
steps:
- checkout
- run: cd web && npm install
- run: cd web && npm run lint
- run: cd web && npm run build
- run: cd web && npm run test:coverage
workflows:
version: 2
concurrently:
jobs:
- cloud-functions
- web
When you checkout, you automatically copy the root of the git repository into the current working directory. If you want your working directory to be a sub-directory of the root, you need to give the checkout step a path that copies the files into a parent of the working directory.
Example:
working_directory: ~/creepy-stories/cloud-functions
steps:
- checkout:
path: ~/creepy-stories
Link to the documentation: https://circleci.com/docs/2.0/configuration-reference/#checkout
I think you've got an added directory in the way.
You should add an extra run to your CircleCi frontend task that does a pwd and then a ls -la.
You'll probably find that the checkout has ended up inside a directory with the same name as your repo.
Edit to answer followup question:
If i remember correctly, the checkout command, always put it in the root of the server, so you can update the working directory to accommodate that. Like so
working_directory: ~/creepy-stories/web
steps:
- checkout
- run: npm install
- run: npm run lint
- run: npm run build
- run: npm run test:coverage

How to resolve sh: react-scripts: command not found?

I used create-react-app to generate an app.
create-react-app myapp
When I run yarn start or npm start I get this error:
react-scripts start
sh: react-scripts: command not found npm ERR! file sh npm ERR! code
ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR!
myapp#0.1.0 start: react-scripts start npm ERR! spawn ENOENT npm
ERR! npm ERR! Failed at the myapp#0.1.0 start script. npm ERR! This
is probably not a problem with npm. There is likely additional logging
output above.
When I run npm ls react:
myapp#0.1.0 /Users/johnno/foosball
└── react#16.2.0
react-scripts is present.
This is my package.json:
{
"name": "myapp",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-scripts": "1.0.17",
"redux": "^3.7.2",
"yarn": "^1.3.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
I tried the suggestions from this but to no avail. How can I fix this issue?
i solved this by deleting
node_modules
yarn.lock
manifest_lock.json
and installed packages by
npm install
or
yarn
Following steps worked for me
delete node_modules folder
delete yarn.lock if you are using yarn command or delete package-lock.json if you are using npm command
run yarn install (for yarn command) or npm install (for npm command)

Resources