Related
Im having trouble with production for my app to heroku.
the log im getting when trying to push from node git:
Counting objects: 100% (194/194), done.
Delta compression using up to 8 threads
Compressing objects: 100% (185/185), done.
Writing objects: 100% (194/194), 703.98 KiB | 4.96 MiB/s, done.
Total 194 (delta 70), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-22 stack
remote: -----> Determining which buildpack to use for this app
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 18.x...
remote: Downloading and installing node 18.13.0...
remote: Using default npm version: 8.19.3
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote:
remote: added 984 packages, and audited 985 packages in 38s
remote:
remote: 40 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: 29 vulnerabilities (8 low, 18 moderate, 3 high)
remote:
remote: To address issues that do not require attention, run:
remote: npm audit fix
remote:
remote: To address all issues (including breaking changes), run:
remote: npm audit fix --force
remote:
remote: Run `npm audit` for details.
remote:
remote: -----> Build
remote: Running heroku-postbuild
remote:
remote: > proshop#1.0.0 heroku-postbuild
remote: > NPM_CONFIG_PRODUCTION=false npm install --prefix frontend && npm run build --prefix frontend
remote:
remote: npm ERR! code ERESOLVE
remote: npm ERR! ERESOLVE could not resolve
remote: npm ERR!
remote: npm ERR! While resolving: react-paypal-button-v2#2.6.3
remote: npm ERR! Found: react#18.2.0
remote: npm ERR! node_modules/react
remote: npm ERR! react#"^18.2.0" from the root project
remote: npm ERR! peer react#"^16.8.0 || ^17.0.0-rc.1 || ^18.0.0" from #react-aria/ssr#3.4.1
remote: npm ERR! node_modules/#react-aria/ssr
remote: npm ERR! #react-aria/ssr#"^3.2.0" from #restart/ui#1.4.1
remote: npm ERR! node_modules/#restart/ui
remote: npm ERR! #restart/ui#"^1.4.1" from react-bootstrap#2.7.0
remote: npm ERR! node_modules/react-bootstrap
remote: npm ERR! react-bootstrap#"^2.7.0" from the root project
remote: npm ERR! 16 more (#restart/hooks, #restart/ui, #testing-library/react, ...)
remote: npm ERR!
remote: npm ERR! Could not resolve dependency:
remote: npm ERR! peer react#"^0.14.6 || 15.x.x || 16.x.x || 17.x.x" from react-paypal-button-v2#2.6.3
remote: npm ERR! node_modules/react-paypal-button-v2
remote: npm ERR! react-paypal-button-v2#"^2.6.3" from the root project
remote: npm ERR!
remote: npm ERR! Conflicting peer dependency: react#17.0.2
remote: npm ERR! node_modules/react
remote: npm ERR! peer react#"^0.14.6 || 15.x.x || 16.x.x || 17.x.x" from react-paypal-button-v2#2.6.3
remote: npm ERR! node_modules/react-paypal-button-v2
remote: npm ERR! react-paypal-button-v2#"^2.6.3" from the root project
remote: npm ERR!
remote: npm ERR! Fix the upstream dependency conflict, or retry
remote: npm ERR! this command with --force, or --legacy-peer-deps
remote: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
remote: npm ERR!
remote: npm ERR! See /tmp/npmcache.luihn/eresolve-report.txt for a full report.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.luihn/_logs/2023-01-10T23_16_50_967Z-debug-0.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: Some possible problems:
remote:
remote: - Node version not specified in package.json
remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: fc7ab23b834a092ca743dc214dafdda32868ba40
remote: !
remote: ! We have detected that you have triggered a build from source code with version
fc7ab23b834a092ca743dc214dafdda32868ba40
remote: ! at least twice. One common cause of this behavior is attempting to deploy code
from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to ikproshop.
remote:
To https://git.heroku.com/ikproshop.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ikproshop.git'
And my code is this file:
import React, { useEffect, useState } from 'react';
import { PayPalButton } from 'react-paypal-button-v2';
// import { PayPalScriptProvider, PayPalButtons } from '#paypal/react-paypal-js';
import axios from 'axios';
import { Link, useParams, useNavigate } from 'react-router-dom';
import { Button, Row, Col, ListGroup, Image, Card } from 'react-bootstrap';
import { useDispatch, useSelector } from 'react-redux';
import Message from '../components/Message';
import Loader from '../components/Loader';
import {
getOrderDetails,
payOrder,
deliverOrder,
} from '../actions/orderActions';
import {
ORDER_PAY_RESET,
ORDER_DELIVER_RESET,
} from '../constants/orderConstants';
const OrderScreen = () => {
const { id } = useParams();
const orderId = id;
const navigate = useNavigate();
const dispatch = useDispatch();
const [sdkReady, setSdkReady] = useState(false);
const orderDetails = useSelector((state) => state.orderDetails);
const { order, loading, error } = orderDetails;
const orderPay = useSelector((state) => state.orderPay);
const { loading: loadingPay, success: successPay } = orderPay;
const orderDeliver = useSelector((state) => state.orderDeliver);
const { loading: loadingDeliver, success: successDeliver } = orderDeliver;
const userLogin = useSelector((state) => state.userLogin);
const { userInfo } = userLogin;
if (!loading) {
// Calculate prices
const addDecimals = (num) => {
return (Math.round(num * 100) / 100).toFixed(2);
};
order.itemsPrice = addDecimals(
order.orderItems.reduce((acc, item) => acc + item.price * item.qty, 0)
);
}
useEffect(() => {
if (!userInfo) {
navigate('/login');
}
const addPayPalScript = async () => {
const { data: clientId } = await axios.get(`/api/config/paypal`);
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = `https://www.paypal.com/sdk/js?client-id=${clientId}`;
script.async = true;
script.onload = () => {
setSdkReady(true);
};
document.body.appendChild(script);
};
if (!order || successPay || successDeliver) {
dispatch({ type: ORDER_PAY_RESET });
dispatch({ type: ORDER_DELIVER_RESET });
dispatch(getOrderDetails(orderId));
} else if (!order.isPaid) {
if (!window.paypal) {
addPayPalScript();
} else {
setSdkReady(true);
}
}
}, [
dispatch,
orderId,
successPay,
successDeliver,
order,
navigate,
userInfo,
]);
const deliverHandler = () => {
dispatch(deliverOrder(order));
};
const successPaymentHandler = (paymentResult) => {
dispatch(payOrder(orderId, paymentResult));
};
return loading ? (
<Loader />
) : error ? (
<Message variant='danger'>{error}</Message>
) : (
<>
<h1>Order {order._id}</h1>
<Row>
<Col md={8}>
<ListGroup variant='flush'>
<ListGroup.Item>
<h2>Shipping</h2>
<p>
<strong>Name: </strong> {order.user.name}
</p>
<p>
<strong>Email: </strong>{' '}
<a href={`mailto:${order.user.email}`}>{order.user.email}</a>
</p>
<p>
<strong>Address:</strong>
{order.shippingAddress.address}, {order.shippingAddress.city},{' '}
{order.shippingAddress.postalCode},{' '}
{order.shippingAddress.country},
</p>
{order.isDelivered ? (
<Message variant='success'>
Delivered on {order.deliveredAt}
</Message>
) : (
<Message variant='danger'>Not Delivered</Message>
)}
</ListGroup.Item>
<ListGroup.Item>
<h2>Payment Method</h2>
<p>
<strong>Method: </strong>
{order.paymentMethod}
</p>
{order.isPaid ? (
<Message variant='success'>Paid on {order.paidAt}</Message>
) : (
<Message variant='danger'>Not Paid</Message>
)}
</ListGroup.Item>
<ListGroup.Item>
<h2>Order Items</h2>
{order.orderItems.length === 0 ? (
<Message>Order Is Eempty</Message>
) : (
<ListGroup variant='flush'>
{order.orderItems.map((item, index) => (
<ListGroup.Item key={index}>
<Row>
<Col md={1}>
<Image
src={item.image}
alt={item.name}
fluid
rounded
/>
</Col>
<Col>
<Link to={`/product/${item.product}`}>
{item.name}
</Link>
</Col>
<Col md={4}>
{item.qty} x ${item.price} = ${item.qty * item.price}
</Col>
</Row>
</ListGroup.Item>
))}
</ListGroup>
)}
</ListGroup.Item>
</ListGroup>
</Col>
<Col md={4}>
<Card>
<ListGroup variant='flush'>
<ListGroup.Item>
<h2>Order Summary</h2>
</ListGroup.Item>
<ListGroup.Item>
<Row>
<Col>Items</Col>
<Col>${order.itemsPrice}</Col>
</Row>
</ListGroup.Item>
<ListGroup.Item>
<Row>
<Col>Shipping</Col>
<Col>${order.shippingPrice}</Col>
</Row>
</ListGroup.Item>
<ListGroup.Item>
<Row>
<Col>Tax</Col>
<Col>${order.taxPrice}</Col>
</Row>
</ListGroup.Item>
<ListGroup.Item>
<Row>
<Col>Total</Col>
<Col>${order.totalPrice}</Col>
</Row>
</ListGroup.Item>
{!order.isPaid && (
<ListGroup.Item>
{loadingPay && <Loader />}
{!sdkReady ? (
<Loader />
) : (
<PayPalButton
amount={order.totalPrice}
onSuccess={successPaymentHandler}
></PayPalButton>
)}
</ListGroup.Item>
)}
{loadingDeliver && <Loader />}
{userInfo &&
userInfo.isAdmin &&
order.isPaid &&
!order.isDelivered && (
<ListGroup.Item>
<Button
type='button'
className='btn btn-block'
onClick={deliverHandler}
>
Mark as Delivered
</Button>
</ListGroup.Item>
)}
</ListGroup>
</Card>
</Col>
</Row>
</>
);
};
export default OrderScreen;
My package.json:
{
"name": "proshop",
"version": "1.0.0",
"description": "MERN shopping cart app",
"main": "server.js",
"type": "module",
"node": "18.6",
"scripts": {
"start": "node backend/server",
"server": "nodemon backend/server",
"client": "npm start --prefix frontend",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"data:import": "node backend/seeder",
"data:destroy": "node backend/seeder -d",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix frontend && npm run build --prefix frontend"
},
"author": "Idan Kfir",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"colors": "^1.4.0",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"express-async-handler": "^1.2.0",
"heroku": "^7.67.1",
"jsonwebtoken": "^9.0.0",
"mongoose": "^6.8.2",
"morgan": "^1.10.0",
"multer": "^1.4.5-lts.1"
},
"devDependencies": {
"concurrently": "^7.6.0",
"nodemon": "^2.0.20"
}
}
Now the bug from what im seeing is with the react-paypal-button-v2 not working along with react version 18.2. (fix me if im wrong)
I tried to use another paypal buttons without changing the context too much but I failed over and over again. even tried with chatGPT to codeReview it and help me change to another framework but it meant changing the whole client id config and such. is there any easy fix for that with a framework which is easier and maybe contact with my code and my sdk that I implement already?
Thanks in advance hope I didn't say too much.
So I found the answer, I had to remove all the paypal checkouts from my dependencies at package.json at the frontend.
also deleted them from node_modules.
Writing this for anybody else who runs with issues with the react-paypal-buttons-v2.
I'm getting the below error when I do npm install in my project
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-scripts#4.0.1
npm ERR! Found: typescript#4.1.3
npm ERR! node_modules/typescript
npm ERR! dev typescript#"^4.1.3" from the root project
npm ERR! peer typescript#">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" from tsutils#3.21.0
npm ERR! node_modules/tsutils
npm ERR! tsutils#"^3.21.0" from #typescript-eslint/eslint-plugin#4.28.3
npm ERR! node_modules/#typescript-eslint/eslint-plugin
npm ERR! peer #typescript-eslint/eslint-plugin#"^4.0.0" from eslint-config-react-app#6.0.0
npm ERR! node_modules/eslint-config-react-app
npm ERR! eslint-config-react-app#"^6.0.0" from react-scripts#4.0.1
npm ERR! node_modules/react-scripts
npm ERR! 2 more (eslint-plugin-jest, react-scripts)
npm ERR! tsutils#"^3.21.0" from #typescript-eslint/typescript-estree#4.28.3
npm ERR! node_modules/#typescript-eslint/typescript-estree
npm ERR! #typescript-eslint/typescript-estree#"4.28.3" from #typescript-eslint/experimental-utils#4.28.3
npm ERR! node_modules/#typescript-eslint/experimental-utils
npm ERR! #typescript-eslint/experimental-utils#"4.28.3" from #typescript-eslint/eslint-plugin#4.28.3
npm ERR! node_modules/#typescript-eslint/eslint-plugin
npm ERR! 1 more (eslint-plugin-jest)
npm ERR! 1 more (#typescript-eslint/parser)
npm ERR! 1 more (#typescript-eslint/typescript-estree)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript#"^3.2.1" from react-scripts#4.0.1
npm ERR! node_modules/react-scripts
npm ERR! dev react-scripts#"^4.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: typescript#3.9.10
npm ERR! node_modules/typescript
npm ERR! peerOptional typescript#"^3.2.1" from react-scripts#4.0.1
npm ERR! node_modules/react-scripts
npm ERR! dev react-scripts#"^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.
This is my package.json
{
"name": "node_modules",
"version": "1.0.7",
"private": true,
"license": "ISC",
"dependencies": {
"#microsoft/applicationinsights-react-js": "^2.3.1",
"#microsoft/applicationinsights-web": "^2.3.1",
"#progress/kendo-common": "^0.2.1",
"#progress/kendo-data-query": "^1.5.4",
"#progress/kendo-drawing": "^1.9.3",
"#progress/kendo-file-saver": "^1.1.0",
"#progress/kendo-react-charts": "^3.18.0",
"#progress/kendo-react-common": "^3.18.0",
"#progress/kendo-react-inputs": "^3.18.0",
"#progress/kendo-react-intl": "^3.18.0",
"#progress/kendo-react-layout": "^3.18.0",
"#progress/kendo-react-popup": "^3.18.0",
"#progress/kendo-theme-default": "^4.32.0",
"#progress/kendo-theme-material": "^3.28.0",
"#telerik/kendo-intl": "^2.3.0",
"async": "^2.6.4",
"azure-maps-control": "^2.0.31",
"ejs": "^3.1.7",
"hammerjs": "^2.0.8",
"jquery": "^3.5.1",
"kendo-ui-react": "^0.14.2",
"minimist": "^1.2.6",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"typescript-collections": "^1.3.3",
"web-vitals": "^0.2.4",
"y18n": "^5.0.5"
},
"devDependencies": {
"#fortawesome/fontawesome-free": "^5.15.2",
"#testing-library/jest-dom": "^5.11.9",
"#testing-library/react": "^11.2.3",
"#testing-library/user-event": "^12.6.2",
"#types/history": "^4.7.8",
"#types/jest": "^26.0.20",
"#types/jquery": "^3.5.5",
"#types/node": "^12.19.15",
"#types/react": "^16.9.0",
"#types/react-dom": "^16.9.0",
"react-scripts": "^4.0.1",
"typescript": "^4.1.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
I don't understand how to fix this issue.
Try doing npm install --legacy-peer-deps
I have created a new project with ANGULAR 12, I am trying to add Jest.js to this project, but I get the next error.
TypeError: Jest: a transform must export something.
at D:\Refraccion\SOFTWARE----\TDD and DBB\demo1\node_modules\#jest\transform\build\ScriptTransformer.js:386:19
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Promise.all (index 0)
at async ScriptTransformer.loadTransformers (D:\Refraccion\SOFTWARE----\TDD and DBB\demo1\node_modules\#jest\transform\build\ScriptTransformer.js:378:5)
at async createScriptTransformer (D:\Refraccion\SOFTWARE----\TDD and DBB\demo1\node_modules\#jest\transform\build\ScriptTransformer.js:1106:3)
at async D:\Refraccion\SOFTWARE----\TDD and DBB\demo1\node_modules\#jest\core\build\TestScheduler.js:269:31
at async Promise.all (index 0)
at async TestScheduler.scheduleTests (D:\Refraccion\SOFTWARE----\TDD and DBB\demo1\node_modules\#jest\core\build\TestScheduler.js:262:5)
at async runJest (D:\Refraccion\SOFTWARE----\TDD and DBB\demo1\node_modules\#jest\core\build\runJest.js:387:19)
at async _run10000 (D:\Refraccion\SOFTWARE----\TDD and DBB\demo1\node_modules\#jest\core\build\cli\index.js:408:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demo1#0.0.0 test: `jest`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demo1#0.0.0 test 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\Tom\AppData\Roaming\npm-cache\_logs\2021-06-06T22_50_07_345Z-debug.log
jest.config.js
module.exports = {
moduleNameMapper: {
'#core/(.*)': '<rootDir>/src/app/core/$1',
},
preset: 'jest-preset-angular',
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
};
package.json
{
"name": "demo1",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"test": "jest",
}
}
Is there some way to fix it in ANGULAR?
Experienced the same thing when I tried to create a new project, so far it isn't compatible with the newest Angular 12 yet that I know of.
I am having an issue with adding laravel-elixir to my package.json file in order to run gulp. When I run the command $ gulp i receive an error stating that laravel-elixir module cannot be found. So, adding the module to my package.json file then running npm install causes an error. (npm install works fine without the laravel-elixir module in package.json)
I have read through all the documentation and have ensured everything is installed. This seems to be a bit of an issue from what i have researched (sorry in advanced if this might be a dublicate). I just cannot seem to find the fix here. Please comment and let me know if you need to see the errors or anything.
package.json
{
"private": true,
"devDependencies": {
"gulp": "^3.9.1",
"gulp-bower": "0.0.13",
"run-sequence": "^1.2.2",
"babel-cli": "^6.7.7",
"babel-preset-es2015": "^6.9.0",
"chai": "^3.5.0",
"laravel-elixir-browserify-official": "^0.1.3",
"laravel-elixir-coffeescript": "^1.0.2",
"laravel-elixir-rollup-official": "^1.0.4",
"laravel-elixir-stylus": "^2.0.2",
"laravel-elixir-vue": "^0.1.4",
"laravel-elixir-webpack-official": "^1.0.1",
"mocha": "^2.4.5",
"rimraf": "^2.5.2",
"laravel-elixir": "^4.0.0"
},
"dependencies": {
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"es2015": "0.0.0",
"gulp-install": "^1.1.0",
"react": "^0.14.6",
"vue": "^1.0.28",
"vue-resource": "^0.5.1",
"vue-router": "^0.7.13",
"vue-validator": "^2.1.7",
"gulp-coffee": "^2.3.1",
"clean-css": "^3.4.12",
"cli-table": "^0.3.1",
"del": "^2.2.0",
"glob": "^7.0.3",
"gulp-autoprefixer": "^3.1.0",
"gulp-batch": "^1.0.5",
"gulp-concat": "^2.6.0",
"gulp-if": "^2.0.0",
"gulp-less": "^3.0.5",
"gulp-load-plugins": "^1.2.2",
"gulp-notify": "^2.2.0",
"gulp-rename": "^1.2.2",
"gulp-rev": "^7.0.0",
"gulp-rev-replace": "^0.4.3",
"gulp-sass": "^3.1.0",
"gulp-shell": "^0.5.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"parse-filepath": "^1.0.1",
"path": "^0.12.7",
"q": "^1.4.1",
"require-dir": "^0.3.2",
"run-sequence": "^1.1.5",
"underscore": "^1.8.3",
"vinyl-map2": "^1.2.1"
}
}
Gulp File
var gulp = require("gulp");
var bower = require("gulp-bower");
var elixir = require("laravel-elixir");
gulp.task('bower', function () {
return bower();
});
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
*/
var vendors = '../../../bower_components/';
var paths = {
'jquery': vendors + 'jquery/dist',
'jqueryUi': vendors + 'jquery-ui',
'moment': vendors + 'moment',
'bootstrap': vendors + 'bootstrap/dist',
'dataTables': vendors + 'datatables/media',
'jquerycookie': vendors + 'jquery.cookie',
'fontawesome': vendors + 'font-awesome',
'animate': vendors + 'animate.css',
'underscore': vendors + 'underscore',
'tether': vendors + 'tether/dist',
'jQueryStorageAPI': vendors + 'jQuery-Storage-API',
'pace': vendors + 'PACE',
'lazyload': vendors + 'lazyload',
'screenfull': vendors + 'screenfull/dist',
'select2': vendors + 'select2/dist',
'select2TabFix': vendors + 'select2-tab-fix',
'eonasdanBootstrapDatetimepicker': vendors + 'eonasdan-bootstrap-datetimepicker/build',
'fullcalendar': vendors + 'fullcalendar/dist',
'summernote': vendors + 'summernote/dist',
'morris': vendors + 'morris.js',
'raphael': vendors + 'raphael',
'algoliasearch': vendors + 'algoliasearch/dist/',
'algoliaAutocomplete': vendors + 'algolia-autocomplete.js/dist/',
'typeahead': vendors + 'typeahead.js/dist/',
'pusher': vendors + 'pusher/dist/',
'icheck': vendors + 'iCheck',
'jasnyBootstrap': vendors + 'jasny-bootstrap/dist',
'toastr': vendors + 'toastr/',
'dropzone': vendors + 'dropzone/dist',
'select2BootstrapTheme': vendors + 'select2-bootstrap-theme/dist',
'c3': vendors + '/c3/'
};
elixir.config.sourcemaps = false;
elixir(function (mix) {
// Run bower install
mix.task('bower');
//Custom Styles
mix.styles(
[
'lcrm_bootstrap.css', 'metisMenu.min.css', 'lcrm.css', 'mail.css'
], 'public/css/secure.css');
//Custom Javascript
mix.browserify(['app.js'], 'public/js/secure.js');
/**
* Vendor files
* run "gulp --production"
*/
if (elixir.config.production) {
// Copy js straight to public
mix.copy('resources/assets/js/metisMenu.min.js', 'public/js');
mix.copy('resources/assets/js/datetime-moment.js', 'public/js');
mix.copy('resources/assets/js/lcrm_app.js', 'public/js');
mix.copy('resources/assets/js/todolist.js', 'public/js');
// Copy fonts straight to public
mix.copy('bower_components/bootstrap/fonts', 'public/fonts/bootstrap');
mix.copy('bower_components/font-awesome/fonts', 'public/fonts');
mix.copy('resources/assets/css/material-design-icons/iconfont', 'public/fonts');
// Copy images straight to public
mix.copy('bower_components/bootstrap-fileinput/img', 'public/img');
mix.copy('bower_components/jquery-ui/themes/base/images', 'public/img');
mix.copy('bower_components/datatables/media/images', 'public/img');
mix.copy('resources/assets/img', 'public/img');
mix.copy('resources/assets/images', 'public/images');
mix.copy('resources/assets/img/logo.png', 'public/uploads/site');
mix.copy('resources/assets/img/fav.ico', 'public/uploads/site');
mix.copy('resources/assets/img/user.png', 'public/uploads/avatar');
// copy js files ( we don't need to combine all files into single js)
mix.copy('bower_components/screenfull/dist/screenfull.min.js', 'public/js');
//c3&d3 chart css and js files
mix.copy('bower_components/c3/c3.min.css', 'public/css');
mix.copy('bower_components/c3/c3.min.js', 'public/js');
mix.copy('bower_components/d3/d3.min.js', 'public/js');
mix.copy('resources/assets/js/d3.v3.min.js', 'public/js');
//jvector map files
mix.copy('bower_components/bower-jvectormap/jquery-jvectormap-1.2.2.min.js', 'public/js');
mix.copy('resources/assets/css/jquery-jvectormap.css', 'public/css');
mix.copy('resources/assets/js/jquery-jvectormap-us-aea-en.js', 'public/js');
//icheck
mix.copy('resources/assets/css/icheck.css','public/css');
mix.copy('bower_components/iCheck/icheck.min.js','public/js');
//countUp
mix.copy('bower_components/countUp.js/dist/countUp.min.js', 'public/js');
//jQuery Sortable
mix.copy('resources/assets/js/jquery-sortable.js', 'public/js');
//CSS Libraries
mix.styles([paths.fontawesome + "/css/font-awesome.min.css",
paths.animate + "/animate.min.css",
"resources/assets/css/material-design-icons/material-design-icons.css",
paths.select2 + "/css/select2.min.css",
paths.eonasdanBootstrapDatetimepicker + '/css/bootstrap-datetimepicker.css',
'dataTables.bootstrap.css',
paths.fullcalendar + '/fullcalendar.css',
paths.summernote + '/summernote.css',
paths.summernote + '/summernote-bs3.css',
paths.morris + '/morris.css',
paths.dropzone + '/dropzone.css',
paths.jasnyBootstrap + "/css/jasny-bootstrap.min.css",
paths.toastr + '/toastr.css',
paths.select2BootstrapTheme + "/select2-bootstrap.min.css"
], 'public/css/libs.css');
//JS Libraries
mix.scripts([paths.jquery + "/jquery.js",
paths.jqueryUi + "/jquery-ui.min.js",
paths.tether + "/js/tether.min.js",
paths.bootstrap + "/js/bootstrap.min.js",
paths.dataTables + "/js/jquery.dataTables.min.js",
paths.dataTables + "/js/dataTables.bootstrap.js",
paths.jquerycookie + "/jquery.cookie.js",
paths.pace + '/pace.min.js',
paths.underscore + "/underscore-min.js",
paths.select2 + "/js/select2.min.js",
paths.select2TabFix + "/src/select2-tab-fix.min.js",
paths.moment + '/moment.js',
paths.eonasdanBootstrapDatetimepicker + '/js/bootstrap-datetimepicker.min.js',
paths.fullcalendar + '/fullcalendar.js',
paths.summernote + '/summernote.js',
paths.morris + '/morris.js',
paths.raphael + '/raphael.js',
paths.algoliasearch + '/algoliasearch.min.js',
paths.algoliaAutocomplete + '/autocomplete.min.js',
paths.typeahead + '/typeahead.jquery.min.js',
paths.pusher + '/pusher.js',
paths.toastr + 'toastr.min.js',
paths.jasnyBootstrap + "/js/jasny-bootstrap.min.js",
"palette.js"
], 'public/js/libs.js');
}
});
Error
npm install
npm WARN deprecated minimatch#1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> node-sass#3.13.1 install C:\xampp\htdocs\trinet\node_modules\laravel-elixir\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> uws#9.14.0 install C:\xampp\htdocs\trinet\node_modules\uws
> node-gyp rebuild > build_log.txt 2>&1 || exit 0
> node-sass#3.13.1 postinstall C:\xampp\htdocs\trinet\node_modules\laravel-elixir\node_modules\node-sass
> node scripts/build.js
Building: C:\Program Files\nodejs\node.exe
C:\xampp\htdocs\trinet\node_modules\node-gyp\bin\node-gyp.js rebuild --
verbose --libsass_ext= --libsass_cflags= --lib
sass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'C:\\xampp\\htdocs\\trinet\\node_modules\\node-
gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp#3.6.2
gyp info using node#8.11.1 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable
"C:/Users/user/AppData/Local/Programs/Python/Python37/python.exe" in the PATH
gyp verb `which` succeeded
C:/Users/user/AppData/Local/Programs/Python/Python37/python.exe
C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe
gyp verb check python version
`C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe -c "import platform; print(platform.python_version());"` retur ned: "3.7.0b3\r\n"
gyp verb could not find "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe". checking python launcher
gyp verb could not find "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\xampp\htdocs\trinet\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\xampp\htdocs\trinet\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\xampp\htdocs\trinet\node_modules\node-gyp\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\xampp\\htdocs\\trinet\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ex t=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\xampp\htdocs\trinet\node_modules\laravel-elixir\node_modules\node-sass
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN buble-loader#0.2.2 requires a peer of buble#^0.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN vue-template-validator#1.1.5 requires a peer of parse5#^2.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package run-sequence is included as both a dev and production dependency.
npm WARN The package babel-preset-es2015 is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} )
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Try installing python first , since it is searching for the executable and unable to find it
I have been compiling my project for many months now and it has never been an issue. I was coding for most of today with npm run watch on. Then suddenly it stop compiling CSS, watch was still running but CSS was not updating.
A commit to Bitbucket reveals the following:
public/mix-manifest.json
{
- "/js/app.js": "/js/app.js",
- "/css/app.css": "/css/app.css"
+ "/js/app.js": "/js/app.js"
}
The app.css has been removed?
public/js/app.js
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId]) {
+/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
-/******/ }
+/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
...
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
-Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
-/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_passwordValidator__ = __webpack_require__(9);
+/* WEBPACK VAR INJECTION */(function($) {Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
+/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_passwordValidator__ = __webpack_require__(9);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_passwordShowHide__ = __webpack_require__(8);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_selectComponent__ = __webpack_require__(10);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_showHideComponent__ = __webpack_require__(11);
...
/* 2 */
/***/ (function(module, exports) {
-// removed by extract-text-webpack-plugin
+throw new Error("Module build failed: ModuleNotFoundError: Module not found: Error: Can't resolve './images/dashboard-details-2.jpg' in 'F:\\openvisa-webapp\\resources\\assets\\sass'\n at factoryCallback (F:\\openvisa-webapp\\node_modules\\webpack\\lib\\Compilation.js:260:39)\n at F:\\openvisa-webapp\\node_modules\\webpack\\lib\\NormalModuleFactory.js:243:19\n at onDoneResolving (F:\\openvisa-webapp\\node_modules\\webpack\\lib\\NormalModuleFactory.js:59:20)\n at F:\\openvisa-webapp\\node_modules\\webpack\\lib\\NormalModuleFactory.js:132:20\n at F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:3799:9\n at F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:360:16\n at iteratorCallback (F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:934:13)\n at F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:844:16\n at F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:3796:13\n at apply (F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:21:25)\n at F:\\openvisa-webapp\\node_modules\\webpack\\node_modules\\async\\dist\\async.js:56:12\n at F:\\openvisa-webapp\\node_modules\\webpack\\lib\\NormalModuleFactory.js:124:22\n at onResolved (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:70:11)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at afterInnerCallback (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:138:10)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at Resolver.applyPluginsAsyncSeriesBailResult1 (F:\\openvisa-webapp\\node_modules\\tapable\\lib\\Tapable.js:181:46)\n at innerCallback (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:125:19)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at F:\\openvisa-webapp\\node_modules\\tapable\\lib\\Tapable.js:283:15\n at F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\UnsafeCachePlugin.js:38:4\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at afterInnerCallback (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:138:10)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at Resolver.applyPluginsAsyncSeriesBailResult1 (F:\\openvisa-webapp\\node_modules\\tapable\\lib\\Tapable.js:181:46)\n at innerCallback (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:125:19)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)\n at F:\\openvisa-webapp\\node_modules\\tapable\\lib\\Tapable.js:283:15\n at innerCallback (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\Resolver.js:123:11)\n at loggingCallbackWrapper (F:\\openvisa-webapp\\node_modules\\enhanced-resolve\\lib\\createInnerCallback.js:31:19)");
/***/ }),
/* 3 */
I've tried putting configuring the public/mix-manifest.json back to the way it was:
public/mix-manifest.json
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css"
}
Run npm run watch or npm run dev and it will just remove the "/css/app.css": "/css/app.css"
public/mix-manifest.json
{
-"/js/app.js": "/js/app.js",
-"/css/app.css": "/css/app.css"
+"/js/app.js": "/js/app.js"
}
The Node Error that I get after running npm run dev is:
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Cory\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v6.11.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! # dev: `node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # dev script 'node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! F:\openvisa-webapp\npm-debug.log
Please note I don't get this error when running npm run watch it just doesn't compile CSS, this Error only comes up on npm run dev. But neitherless the error is still there on watch.
I have no idea how to fix it. I've tried npm install, but nothing works.
Issue has been resolved. This will happen if your CSS background images don't have a correct path.