jest: not found after npm install on Azure pipeline - azure

Problem
I'm running this pipeline file on Azure but I'm experiencing that a package is not found. I want to run tests using Jest with the command npm test after installing the packages with npm install. Jest is in the devDependencies in the package.json, I and think that's why it's not begin installed on azure.
sh: 1: jest: not found
pipeline.yaml:
parameters:
triggerType: ''
jobs:
- job: RunTests
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NodeTool#0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install -registry [[[[https://myregistryurl]]]]
displayName: 'npm install'
- script: npm test
displayName: 'npm test'
package.json
{
"name": "ssu-dashboard-client",
"version": "2.3.1",
"description": "Dashboard for operation planning",
"main": "server.js",
"author": "Olavstoppen",
"repository": {},
"license": "MIT",
"scripts": {
"dev": "cross-env NODE_ENV=development nodemon --watch webpack.config.js --watch server.js",
"dev:inspect": "cross-env NODE_ENV=development nodemon --inspect server.js ",
"build": "cross-env NODE_ENV=production webpack --mode production",
"start": "cross-env NODE_ENV=production node server.js",
"test": "jest"
},
"dependencies": {
"#babel/preset-flow": "^7.12.1",
"applicationinsights-js": "^1.0.20",
"axios": "^0.18.1",
"babel-jest": "^26.6.3",
"babel-preset-jest": "^26.6.2",
"color": "^3.1.1",
"connected-react-router": "^6.4.0",
"d3": "^5.9.2",
"date-fns": "^2.12.0",
"date-fns-tz": "^1.0.10",
"highcharts": "7.1.2",
"highcharts-drilldown": "^0.1.7",
"highcharts-more": "^0.1.7",
"highcharts-react-official": "^2.2.2",
"history": "^4.9.0",
"prop-types": "^15.7.2",
"ramda": "^0.26.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-google-charts": "^2.0.29",
"react-highcharts": "^16.0.2",
"react-is": "^16.13.1",
"react-json-tree": "^0.11.2",
"react-measure": "^2.3.0",
"react-redux": "^7.0.3",
"react-router": "^5.0.0",
"react-router-dom": "^5.0.0",
"react-router-hash-link": "^1.2.1",
"react-saga": "^0.2.6",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-saga": "^0.16.2",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"sanitize-html": "^2.1.2",
"styled-components": "^5.2.1",
"styled-system": "^5.1.5",
"tinymce": "^5.4.2"
},
"devDependencies": {
"#babel/core": "^7.4.4",
"#babel/plugin-proposal-class-properties": "^7.12.1",
"#babel/plugin-proposal-decorators": "^7.4.4",
"#babel/plugin-proposal-export-namespace-from": "^7.2.0",
"#babel/plugin-proposal-function-sent": "^7.2.0",
"#babel/plugin-proposal-json-strings": "^7.2.0",
"#babel/plugin-proposal-numeric-separator": "^7.2.0",
"#babel/plugin-proposal-throw-expressions": "^7.2.0",
"#babel/plugin-syntax-dynamic-import": "^7.8.3",
"#babel/plugin-syntax-import-meta": "^7.2.0",
"#babel/plugin-transform-runtime": "^7.4.4",
"#babel/polyfill": "^7.4.4",
"#babel/preset-env": "^7.12.1",
"#babel/preset-react": "^7.12.5",
"#hot-loader/react-dom": "^16.8.6",
"#svgr/webpack": "^4.2.0",
"#testing-library/jest-dom": "^5.11.6",
"#testing-library/react": "^11.1.2",
"adal-node": "^0.1.28",
"applicationinsights": "^1.3.1",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.5",
"babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-import": "^1.11.0",
"babel-plugin-styled-components": "^1.10.0",
"body-parser": "^1.19.0",
"connect-logger": "0.0.1",
"cookie-parser": "^1.4.4",
"cookie-session": "^2.0.0-beta.3",
"copy-webpack-plugin": "^4.6.0",
"core-js": "^3.0.1",
"cross-env": "^5.2.0",
"css-loader": "^1.0.1",
"dotenv": "^6.2.0",
"dotenv-webpack": "^1.7.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^3.6.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-styled-components-config": "^0.0.2",
"express": "^4.16.4",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^2.0.0",
"helmet": "^3.16.0",
"html-webpack-plugin": "^3.0.7",
"identity-obj-proxy": "^3.0.0",
"jest": "^26.6.3",
"jest-styled-components": "^7.0.3",
"jest-svg-transformer": "^1.0.0",
"node-sass": "^4.13.0",
"nodemon": "^1.19.0",
"postcss-loader": "^3.0.0",
"prettier-eslint": "^8.8.2",
"react-hot-loader": "^4.8.4",
"redux-mock-store": "^1.5.4",
"regenerator-runtime": "^0.13.2",
"sass-loader": "^7.0.3",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.2.3",
"url-loader": "^1.1.2",
"webpack": "^4.39.0",
"webpack-cli": "^3.3.1",
"webpack-dev-server": "^3.3.1",
"webpack-hot-middleware": "^2.24.4",
"webpack-merge": "^4.2.1",
"worker-loader": "^2.0.0"
},
"jest": {
"globals": {
"NODE_ENV": "test"
},
"transform": {
"\\.[jt]sx?$": "babel-jest",
"^.+\\.svg$": "jest-svg-transformer"
},
"verbose": false,
"rootDir": ".",
"collectCoverageFrom": [
"**/*.{js,jsx,ts,tsx}",
"!**/*.d.ts"
],
"moduleFileExtensions": [
"js",
"jsx",
"ts",
"tsx"
],
"moduleNameMapper": {
"\\.(css|less|scss|sass)$": "identity-obj-proxy",
"^components/(.*)$": "<rootDir>/src/components/$1",
"^utils/(.*)$": "<rootDir>/src/utils/$1",
"^locales(.*)$": "<rootDir>/src/locales/$1",
"^assets(.*)$": "<rootDir>/src/assets/$1",
"^styles/(.*)$": "<rootDir>/src/styles/$1"
},
"modulePathIgnorePatterns": [
"./dist"
],
"coverageDirectory": "<rootDir>/tests/coverage/"
}
}
My package.json is at the root of the project.
What I have tried
I tried what was suggested underneath, but now I'm getting
npm install -registry [[[[https://myregistryurl]]]]
========================== Starting Command Output ===========================
##[debug]which 'bash'
##[debug]found: '/bin/bash'
##[debug]which '/bin/bash'
##[debug]found: '/bin/bash'
##[debug]/bin/bash arg: --noprofile
##[debug]/bin/bash arg: --norc
##[debug]/bin/bash arg: /home/vsts/work/_temp/7aa1a129-08a3-43cb-8973-ce9f3c9748c4.sh
##[debug]exec tool: /bin/bash
##[debug]arguments:
##[debug] --noprofile
##[debug] --norc
##[debug] /home/vsts/work/_temp/7aa1a129-08a3-43cb-8973-ce9f3c9748c4.sh
/bin/bash --noprofile --norc /home/vsts/work/_temp/7aa1a129-08a3-43cb-8973-ce9f3c9748c4.sh
npm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! /home/vsts/.npm/_logs/2020-12-01T09_22_16_890Z-debug.log
##[debug]Exit code 1 received from tool '/bin/bash'
Could this be because the vmImages' being created are filling up the azure cache or something?
I tried adding - script: npm cache clean --f but this did not do anything.
Update
It seems like the error is related to the registry, where I get a bunch of 401's
npm http fetch GET 401 ...
npm http fetch GET 401 ...
npm http fetch GET 401 ...
npm http fetch GET 401 ...
npm http fetch GET 401 ...
...

I'm quite 100% sure this is correct. But I'm suspecting the issue from the path execution file between locally vs azure pipeline.
Can you try as following by creating a script test on CI?
package.json
{
"test:ci": "node_modules/.bin/jest"
}
Then you execute this command instead of local one:
- script: npm run test:ci

Related

Laravel Mix: npm ERR! While resolving: undefined#undefined, Found: webpack#5.60.0

I recently tried to run npm update, but I get this error given below. I tried googling it but didn't find the solution to it. Below is the error which I get in my console.
I later also tried to run npm audit fix but this time got different error
webpack.mix.js
const mix = require('laravel-mix');
require('laravel-mix-modernizr');
mix.setPublicPath('public')
.setResourceRoot('../')
.vue()
.sass('resources/sass/frontend/app.scss', 'css/frontend.css')
.sass('resources/sass/backend/app.scss', 'css/backend.css')
.js('resources/js/frontend/app.js', 'js/frontend.js')
.js([
'resources/js/backend/before.js',
'resources/js/backend/app.js',
'resources/js/backend/after.js'
], 'js/backend.js')
.js('resources/js/global.js', 'js/global.js')
.js('resources/js/Banners/banner.js', 'js/banner.js')
.extract([
// Extract packages from node_modules to vendor.js
'alpinejs',
'jquery',
'bootstrap',
'popper.js',
'axios',
'sweetalert2',
'lodash'
])
.sourceMaps()
.modernizr();
if (mix.inProduction()) {
mix.version();
} else {
// Uses inline source-maps on development
mix.webpackConfig({
devtool: 'inline-source-map'
});
}
Mixin is happening fine but I don't understand why am I getting this error given above. I don't know where I am going wrong here. I also tried to run npm rebuild node-sass and then again tried to run npm update & also npm audit fix, but none worked.
Added
package.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
"devDependencies": {
"#coreui/coreui": "^2.1.16",
"#fortawesome/fontawesome-free": "^5.15.3",
"#popperjs/core": "^2.0.6",
"#vue/test-utils": "^1.1.2",
"alpinejs": "^3.2.2",
"axios": "^0.21.1",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.1",
"babel-preset-env": "^1.7.0",
"bootstrap": "^5.1.1",
"cross-env": "^7.0",
"cross-var": "^1.1.0",
"css-loader": "^5.2.7",
"jest": "^26.6.3",
"jquery": "^3.5.1",
"laravel-echo": "^1.10.0",
"laravel-mix": "^6.0.25",
"laravel-mix-modernizr": "^1.0.2",
"livewire-vue": "^0.3.1",
"lodash": "^4.17.21",
"perfect-scrollbar": "^1.5.0",
"popper.js": "^1.16.1",
"pusher-js": "^7.0.3",
"resolve-url-loader": "^3.1.2",
"sass": "^1.32.8",
"sass-loader": "^12.1.0",
"socket.io-client": "^3.1.2",
"sweetalert2": "^11.0.19",
"vue": "^2.6.12",
"vue-jest": "^3.0.7",
"vue-template-compiler": "^2.6.12",
"webpack": "^5.46.0",
"webpack-cli": "^4.7.2",
"webpack-modernizr-loader": "^5.0.0"
},
"jest": {
"testURL": "http://localhost",
"roots": [
"<rootDir>/tests/Javascript/"
],
"moduleNameMapper": {
"^#/(.*)$": "<rootDir>/resources/js/$1"
},
"moduleFileExtensions": [
"js",
"vue"
],
"transform": {
"^.+\\.js$": "babel-jest",
".*\\.(vue)$": "vue-jest"
}
},
"dependencies": {
"#babel/polyfill": "^7.12.1",
"#chakra-ui/vue": "^0.6.6",
"acorn": "^8.0.4",
"babel-preset": "^1.1.7",
"bootstrap-icons": "^1.5.0",
"bootstrap-vue": "^2.19.0",
"bufferutil": "^4.0.2",
"canvas": "^2.6.1",
"clipboard": "^2.0.6",
"confetti-js": "^0.0.18",
"copy-webpack-plugin": "^9.0.1",
"core-js": "^3.7.0",
"datetimepicker": "^0.1.39",
"formBuilder": "^3.6.1",
"html2canvas": "^1.0.0-rc.7",
"imagemagick": "^0.1.3",
"intersection-observer": "^0.11.0",
"js-cookie": "^2.2.1",
"lodash.remove": "^4.7.0",
"node-sass": "^6.0.0",
"portal-vue": "^2.1.7",
"puppeteer": "^10.4.0",
"react": "^17.0.1",
"regenerator-runtime": "^0.13.7",
"sweetalert": "^2.1.2",
"utf-8-validate": "^5.0.3",
"vee-validate": "^3.3.0",
"vue-chat-scroll": "^1.4.0",
"vue-loader": "^15.9.6",
"vue-router": "^3.5.1",
"vue-timeago": "^5.1.2",
"webrtc-adapter": "^7.7.0",
"yargs-parser": "^20.2.4"
},
"resolutions": {
"yargs-parser": "^19.0.1"
}
}

Electron Error ENOENT: no such file or directory, open 'electron' After update from 9 to 10

Recently I update electron version from 9 to 10 and after updated getting this error on debug mode only
when I downgrade to 9 it's working correctly
Deleted Node_Module and package.lock file multiple times and reinstall all package but no luck
I tried to upgrade to 11 electrons also but facing the same issue
When I am running in production mode "Yarn Start" is working fine
The issue in dev mode only "Yarn dev"
ERROR:-
App threw an error during load Error: ENOENT: no such file or directory, open 'electron'
at Object.openSync (fs.js:462:3)
at Object.func [as openSync] (electron/js2c/asar.js:140:31)
at Object.readFileSync (fs.js:364:35)
at Object.fs.readFileSync (electron/js2c/asar.js:542:40)
at Module._extensions..js (internal/modules/cjs/loader.js:1165:22)
at Object.newLoader [as .js] (C:\SVN\mangocrossplatform\trunk\node_modules\pirates\lib\index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:981:32)
at Module._load (internal/modules/cjs/loader.js:881:14)
at Function.Module._load (electron/js2c/asar.js:779:28)
at Module.require (internal/modules/cjs/loader.js:1023:19)
My Package.json File
{
"name": "mangoapps-messenger",
"productName": "Apps Messenger",
"version": "15.0.11",
"description": "Apps Messenger - An Universal Messenger For Apps",
"homepage": "",
"author": {
"email": "",
"name": ""
},
"scripts": {
"build": "yarn clean && concurrently \"yarn build-main\" \"yarn build-renderer\"",
"build-dll": "cross-env NODE_ENV=development webpack --config ./configs/webpack.config.renderer.dev.dll.babel.js --colors",
"build-main": "cross-env NODE_ENV=production webpack --config ./configs/webpack.config.main.prod.babel.js --colors",
"build-renderer": "cross-env NODE_ENV=production webpack --config ./configs/webpack.config.renderer.prod.babel.js --colors",
"dev": "yarn clean && cross-env START_HOT=1 node -r #babel/register ./internals/scripts/CheckPortInUse.js && cross-env START_HOT=1 yarn start-renderer-dev",
"package": "yarn build && electron-builder build --publish never",
"package-linux": "yarn build && electron-builder build --linux",
"package-mac": "yarn build && CSC_LINK=./certs/mac.p12 && CSC_IDENTITY_AUTO_DISCOVER=false && electron-builder build --mac",
"package-win": "yarn build && electron-builder build --win --x64",
"package-win32": "yarn build && electron-builder build --win --ia32",
"postinstall": "electron-builder install-app-deps && yarn build-dll && opencollective-postinstall",
"preinstall": "node ./internals/scripts/CheckYarn.js",
"prestart": "yarn build",
"start": "cross-env NODE_ENV=production electron ./dist/main.prod.js",
"start-main-dev": "cross-env HOT=1 NODE_ENV=development electron -r #babel/register ./app/main.dev.js",
"start-renderer-dev": "cross-env NODE_ENV=development webpack-dev-server --config configs/webpack.config.renderer.dev.babel.js",
"clean": "rimraf dist/"
},
"main": "./dist/main.prod.js",
"build": {
"productName": "Apps Messenger",
"appId": "com.mangoapps.electrondesktop",
"artifactName": "${name}-${version}.${ext}",
"generateUpdatesFilesForAllChannels": true,
"mac": {
"category": "productivity",
"type": "distribution",
"provisioningProfile": "certs/mac.provisionprofile",
"identity": "sdasdB",
"hardenedRuntime": true,
"entitlements": "build/entitlements.mac.inherit.plist",
"entitlementsInherit": "build/entitlements.mac.inherit.plist",
"gatekeeperAssess": false,
"extendInfo": {
"NSAppTransportSecurity": {
"NSAllowsArbitraryLoads": true,
"NSMicrophoneUsageDescription": "This lets you share using audio using the microphone.",
"NSCameraUsageDescription": "This lets you share a photo or video taken from your camera.",
"NSContactsUsageDescription": "This lets you enable access to your contacts and uses them to invite."
}
},
"target": [
"zip"
]
},
"linux": {
"target": [
"deb"
],
"category": "Productivity"
},
"win": {
"target": [
"nsis",
"msi"
],
"certificateFile": "",
"certificatePassword": "",
"publisherName": "",
"requestedExecutionLevel": "asInvoker",
"signAndEditExecutable": true,
"signDlls": true
},
"nsis": {
"oneClick": true,
"perMachine": false,
"deleteAppDataOnUninstall": true
},
"msi": {
"oneClick": true,
"perMachine": true
},
"files": [
"resources",
"dist/",
"dist/main.prod.js",
"dist/main.prod.js.map",
"package.json"
],
"directories": {
"buildResources": "resources",
"output": "release"
}
},
"keywords": [
"mangoapps",
"messenger"
],
"devDependencies": {
"#babel/core": "^7.4.0",
"#babel/plugin-proposal-class-properties": "^7.4.0",
"#babel/plugin-proposal-decorators": "^7.4.0",
"#babel/plugin-proposal-do-expressions": "^7.2.0",
"#babel/plugin-proposal-export-default-from": "^7.2.0",
"#babel/plugin-proposal-export-namespace-from": "^7.2.0",
"#babel/plugin-proposal-function-bind": "^7.2.0",
"#babel/plugin-proposal-function-sent": "^7.2.0",
"#babel/plugin-proposal-json-strings": "^7.2.0",
"#babel/plugin-proposal-logical-assignment-operators": "^7.2.0",
"#babel/plugin-proposal-nullish-coalescing-operator": "^7.2.0",
"#babel/plugin-proposal-numeric-separator": "^7.2.0",
"#babel/plugin-proposal-optional-chaining": "^7.2.0",
"#babel/plugin-proposal-pipeline-operator": "^7.3.2",
"#babel/plugin-proposal-throw-expressions": "^7.2.0",
"#babel/plugin-syntax-dynamic-import": "^7.2.0",
"#babel/plugin-syntax-import-meta": "^7.2.0",
"#babel/plugin-transform-react-constant-elements": "^7.2.0",
"#babel/plugin-transform-react-inline-elements": "^7.2.0",
"#babel/preset-env": "^7.4.2",
"#babel/preset-flow": "^7.0.0",
"#babel/preset-react": "^7.0.0",
"#babel/register": "^7.4.0",
"#fortawesome/fontawesome-pro": "^5.12.0",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "^24.5.0",
"babel-loader": "^8.0.5",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"babel-register": "^6.26.0",
"chalk": "^2.4.2",
"concurrently": "^4.1.0",
"cross-env": "^5.2.0",
"cross-spawn": "^6.0.5",
"css-loader": "2.1.1",
"detect-port": "^1.3.0",
"electron": "^10.0.0",
"electron-builder": "^22.9.1",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.11.2",
"enzyme-to-json": "^3.3.5",
"fbjs-scripts": "^1.2.0",
"file-loader": "^4.2.0",
"html-webpack-plugin": "^3.2.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.5.0",
"mini-css-extract-plugin": "^0.8.0",
"node-sass": "^4.13.0",
"opencollective-postinstall": "^2.0.2",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"prettier": "^1.16.4",
"react-svg-loader": "^3.0.3",
"react-test-renderer": "^16.8.6",
"redux-logger": "^3.0.6",
"rimraf": "^3.0.0",
"sass-loader": "^7.1.0",
"sinon": "^7.3.1",
"spectron": "^5.0.0",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^1.2.3",
"testcafe": "^1.1.0",
"testcafe-browser-provider-electron": "^0.0.8",
"testcafe-live": "^0.1.4",
"testcafe-react-selectors": "^3.1.0",
"url-loader": "^1.1.2",
"webpack": "^4.29.6",
"webpack-bundle-analyzer": "^3.1.0",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.2.1",
"webpack-merge": "^4.2.1",
"yarn": "^1.16.0"
},
"dependencies": {
"#babel/polyfill": "^7.7.0",
"#fortawesome/fontawesome-svg-core": "^1.2.26",
"#fortawesome/free-solid-svg-icons": "^5.12.0",
"#fortawesome/pro-duotone-svg-icons": "^5.12.0",
"#fortawesome/pro-light-svg-icons": "^5.12.0",
"#fortawesome/pro-regular-svg-icons": "^5.12.0",
"#fortawesome/pro-solid-svg-icons": "^5.12.0",
"#fortawesome/react-fontawesome": "^0.1.8",
"#trodi/electron-splashscreen": "^0.3.4",
"app-root-path": "^2.2.1",
"axios": "^0.21.1",
"babel-runtime": "^6.26.0",
"bootstrap": "^4.3.1",
"check-internet-connected": "^2.0.4",
"connected-react-router": "^6.3.2",
"copy-webpack-plugin": "^5.1.1",
"core-js": "2",
"custom-electron-titlebar": "^3.2.2-hotfix62",
"devtron": "^1.4.0",
"dotenv": "^8.2.0",
"electron-debug": "^2.1.0",
"electron-dl": "^3.0.2",
"electron-fetch": "^1.3.0",
"electron-localshortcut": "^3.1.0",
"electron-log": "^4.1.1",
"electron-positioner": "^4.1.0",
"electron-splashscreen": "^0.1.7",
"electron-store": "^3.2.0",
"electron-unhandled": "^3.0.2",
"electron-util": "^0.14.1",
"electron-window-state": "^5.0.3",
"emoji-mart": "^2.11.1",
"form-data": "^2.3.3",
"fs-extra": "^8.1.0",
"jquery": "^3.3.1",
"js-md5": "^0.7.3",
"lodash": "^4.17.15",
"mime-types": "^2.1.27",
"moment-timezone": "^0.5.27",
"node-mac-notifier": "file:local_dep/node-mac-notifier",
"node-machine-id": "^1.1.12",
"node-notifier": "^8.0.0",
"platform-folders": "^0.4.1",
"plist": "^3.0.1",
"popper.js": "^1.15.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-hot-loader": "^4.12.15",
"react-image-crop": "^8.4.0",
"react-lazyload": "^2.6.2",
"react-page-layout": "^0.9.8",
"react-phone-input-2": "^2.13.9",
"react-player": "^1.15.2",
"react-redux": "^7.2.0",
"react-router": "^5.0.0",
"react-router-dom": "^5.0.0",
"react-select": "^3.0.3",
"react-tenor": "^2.1.1",
"react-toastify": "^6.0.8",
"reactstrap": "^8.5.1",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"source-map-support": "^0.5.11",
"styled-components": "^5.0.0",
"universal-analytics": "^0.4.23",
"xml2js": "^0.4.19",
"zip-folder": "^1.0.0"
},
"devEngines": {
"node": ">=12.13.0",
"npm": ">=6.12.0",
"yarn": ">=1.19.0"
},
"browserslist": [
"defaults"
]
}

Webpack Broken after installing vuex-persistedstate

I have broken my webpack installation after installing vuex-persistedstate. I have removed the node modules folder and the package-lock.json file and re-installed, but I am still receiving the following error when trying to run my project:
npm ERR! client#1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client#1.0.0 dev script.
I have deleted the /node_modules folder and package-lock.json file, and ran the following commands:
npm install
npm run build
npm start
My package.json file contains the following packages:
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
"build": "node build/build.js"
},
"dependencies": {
"ajv": "^6.10.2",
"axios": "^0.19.0",
"babel-polyfill": "^6.26.0",
"bootstrap": "^4.3.1",
"bootstrap-vue": "^2.0.0",
"jquery": "^3.5.1",
"popper.js": "^1.15.0",
"vue": "^2.5.2",
"vue-cookies": "^1.5.13",
"vue-js-modal": "^1.3.31",
"vue-router": "^3.0.1",
"vuejs-dialog": "^1.4.1",
"vuex": "^3.5.1",
"vuex-persistedstate": "^3.0.1",
"web3": "^1.2.1"
},
"devDependencies": {
"#types/node": "^12.7.5",
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^8.2.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"babel-plugin-istanbul": "^5.2.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chai": "^4.1.2",
"chalk": "^2.0.1",
"chromedriver": "^2.27.2",
"copy-webpack-plugin": "^6.0.3",
"cross-env": "^5.0.1",
"cross-spawn": "^5.0.1",
"css-loader": "^3.1.0",
"eslint": "^4.15.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^2.30.1",
"inject-loader": "^3.0.0",
"karma": "^5.1.1",
"karma-coverage": "^2.0.3",
"karma-mocha": "^2.0.1",
"karma-phantomjs-launcher": "^1.0.2",
"karma-phantomjs-shim": "^1.4.0",
"karma-sinon-chai": "^1.3.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.31",
"karma-webpack": "^2.0.2",
"mini-css-extract-plugin": "^0.8.0",
"mocha": "^8.0.1",
"nightwatch": "^1.3.7",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"phantomjs-prebuilt": "^2.1.14",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"selenium-server": "^3.0.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"sinon": "^4.0.0",
"sinon-chai": "^2.8.0",
"style-loader": "^1.0.0",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^2.1.0",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^4.44.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.3.8",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]

Gitlab CI/CD: Cannot find module: 'src/css/index.css'. Make sure this package is installed

I'm trying to build my React Webpack app on Gitlabs CI/CD.
Within my Webpack configuration I use the Sentry plugin to send sourcemaps so I am trying to build my app in the CI/CD container.
Here is my gitlab-ci.yml
image: node
stages:
- lint
- prepare
eslint:
stage: lint
script:
# Install eslint
- |
npm install eslint \
eslint-plugin-react \
babel-eslint
# Run eslint
- npm run lint
flow:
stage: lint
script:
# install flow
- yarn add flow-bin
- yarn run lint
sentry:
stage: prepare
script:
- npm i
environment:
name: production
only:
- master
and here is my package.json
"dependencies": {
"#babel/core": "7.1.6",
"#sentry/browser": "^4.5.1",
"#sentry/webpack-plugin": "^1.6.2",
"#svgr/webpack": "2.4.1",
"axios": "^0.18.0",
"bfj": "6.1.1",
"case-sensitive-paths-webpack-plugin": "2.1.2",
"chalk": "2.4.1",
"cors": "^2.8.5",
"cross-env": "^5.2.0",
"css-loader": "1.0.0",
"dotenv": "6.0.0",
"dotenv-expand": "4.2.0",
"express": "^4.16.4",
"express-http-proxy": "^1.5.0",
"file-loader": "2.0.0",
"fork-ts-checker-webpack-plugin-alt": "0.4.14",
"fs-extra": "7.0.0",
"html-webpack-plugin": "4.0.0-alpha.2",
"humps": "^2.0.1",
"identity-obj-proxy": "3.0.0",
"jest": "23.6.0",
"jest-pnp-resolver": "1.0.1",
"jest-resolve": "23.6.0",
"js-cookie": "^2.2.0",
"mini-css-extract-plugin": "0.4.3",
"moment": "^2.24.0",
"normalizr": "^3.3.0",
"optimize-css-assets-webpack-plugin": "5.0.1",
"pnp-webpack-plugin": "1.1.0",
"postcss-flexbugs-fixes": "4.1.0",
"postcss-loader": "3.0.0",
"postcss-preset-env": "6.3.1",
"postcss-safe-parser": "4.0.1",
"react": "^16.8.0",
"react-app-polyfill": "^0.2.0",
"react-circle": "^1.1.1",
"react-dev-utils": "^7.0.1",
"react-dom": "^16.8.0",
"react-ga": "^2.5.7",
"react-grid-system": "^4.4.1",
"react-helmet": "^5.2.0",
"react-keyboard-event-handler": "^1.4.1",
"react-media": "^1.9.2",
"react-player": "^1.8.0",
"react-redux": "^6.0.0",
"react-router-dom": "^4.3.1",
"react-slack-feedback": "^2.0.4",
"react-transition-group": "^2.5.3",
"redux": "^4.0.1",
"redux-api-middleware": "^3.0.1",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"resolve": "1.8.1",
"sass-loader": "7.1.0",
"scrollto-with-animation": "^4.5.2",
"signale": "^1.4.0",
"striptags": "^3.1.1",
"style-loader": "0.23.0",
"styled-components": "^4.1.3",
"terser-webpack-plugin": "1.1.0",
"url-loader": "1.1.1",
"webpack": "4.19.1",
"webpack-dev-server": "3.1.14",
"webpack-manifest-plugin": "2.0.4",
"workbox-webpack-plugin": "3.6.3",
},
"scripts": {
"postinstall": "cross-env NODE_ENV=production npm run build && patch-package",
"start": "node server.js",
"dev": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js",
"storybook": "start-storybook -p 9001 -c .storybook",
"lint": "eslint ./src ./stories",
"flow": "flow ./src"
},
"devDependencies": {
"#storybook/addon-info": "^4.1.11",
"#storybook/addon-knobs": "^4.1.6",
"#storybook/addon-notes": "^4.1.6",
"#storybook/react": "^4.1.6",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "9.0.0",
"babel-jest": "23.6.0",
"babel-loader": "^8.0.4",
"babel-plugin-named-asset-import": "^0.3.0",
"babel-preset-react-app": "^7.0.0",
"eslint": "5.6.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-loader": "2.1.1",
"eslint-plugin-flowtype": "^3.2.1",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-react": "^7.12.4",
"flow-bin": "^0.90.0",
"husky": "^1.3.1",
"patch-package": "^6.0.4",
"prettier": "^1.15.3",
"prop-types": "^15.7.2",
"redux-devtools-extension": "^2.13.7"
},
It builds fine on locally but not in the CI/CD runner.
In my application I had and .env file setting the NODE_ENV
After messing around for ages I had to set the NODE_ENV when I executed npm run build
"scripts": {
"postinstall": "export NODE_ENV=production NODE_PATH=. && npm run build && patch-package"
}

Deploy error on Heroku with /app/karma.config.js

I got a React project with node.js, and want to deploy it on Heroku, I connect Heroku with my github repository: https://github.com/yeziyqf/SecureProgramConc
When the project building on Heroku, I got following error:
-----> Running Node.js buildpack tests...
essential-react#0.3.0 test /app
PHANTOMJS_BIN=./node_modules/.bin/phantomjs ./node_modules/karma/bin/karma start karma.config.js
07 03 2018 04:50:38.115:ERROR [config]: File /app/karma.config.js does not exist!
npm ERR! Test failed. See above for more details.
-----> Node.js buildpack tests failed with exit status 1
What is this problem? Locally I don't have this config file but my project works fine, anybody have a clue on it? Thanks!
Here is the package.json file:
{
"name": "essential-react",
"version": "0.3.0",
"description": "A minimal skeleton for building testable React apps using ES6.",
"main": "src/main.jsx",
"scripts": {
"postinstall": "npm run build",
"server": "node server.js",
"build": "webpack -p --config webpack.production.config.js",
"test": "PHANTOMJS_BIN=./node_modules/.bin/phantomjs ./node_modules/karma/bin/karma start karma.conf.js",
"test-cross-browser": "./node_modules/karma/bin/karma start karma.cross-browser.config.js",
"coveralls": "cat coverage/lcov.info | coveralls",
"clean": "rm build/app.js"
},
"repository": {
"type": "git",
"url": "https://github.com/pheuter/essential-react.git"
},
"keywords": [
"skeleton",
"template",
"react",
"quickstart"
],
"author": "Mark Fayngersh",
"license": "MIT",
"bugs": {
"url": "https://github.com/pheuter/essential-react/issues"
},
"homepage": "https://github.com/pheuter/essential-react",
"devDependencies": {
"coveralls": "^2.11.2",
"istanbul": "^0.3.7",
"istanbul-instrumenter-loader": "^0.1.2",
"karma": "^0.13.22",
"karma-coverage": "^0.2.7",
"karma-mocha": "^0.1.10",
"karma-phantomjs-launcher": "^0.1.4",
"karma-sauce-launcher": "^0.2.10",
"karma-sinon-chai": "^0.3.0",
"karma-webpack": "^1.5.0",
"phantomjs": "^1.9.16",
"react-hot-loader": "^1.2.3",
"react-scripts": "0.2.1",
"webpack-dev-server": "^1.7.0"
},
"dependencies": {
"autoprefixer": "^6.0.2",
"babel-core": "^5.4.7",
"babel-loader": "^5.1.3",
"bootstrap": "^3.3.5",
"bootstrap-social": "^4.9.1",
"bundle-loader": "^0.5.4",
"classnames": "^2.2.0",
"css-loader": "^0.28.9",
"express": "^4.12.3",
"extract-text-webpack-plugin": "^0.8.2",
"file-loader": "^0.8.4",
"firebase": "^4.10.0",
"font-awesome": "^4.4.0",
"history": "^1.13.0",
"jquery": "^2.1.4",
"lazy": "^1.0.11",
"less": "^2.5.3",
"less-loader": "^2.2.1",
"normalizr": "^1.1.0",
"nprogress": "^0.2.0",
"postcss-loader": "^0.6.0",
"postcss-nested": "^1.0.0",
"react": "^0.14.9",
"react-addons-css-transition-group": "^0.14.1",
"react-addons-transition-group": "^0.14.2",
"react-addons-update": "^15.3.0",
"react-bootstrap": "^0.27.0",
"react-dom": "^0.14.1",
"react-native-multiple-choice": "0.0.8",
"react-redux": "^5.0.7",
"react-router": "^1.0.0-rc2",
"react-router-redux": "^4.0.8",
"react-select": "^1.2.1",
"redux": "^3.7.2",
"resource-api-utils": "^1.0.0",
"style-loader": "^0.12.3",
"url-loader": "^0.5.6",
"webpack": "^1.12.1"
}
}

Resources