I have a Vue application which is running live and node version is 8. I have clone this application, I deleted the package.lock file and node_module folder, and run npm i, I have node 12.18 installed on my mechine, after successful installation, I try to run appplication by npm run dev, but getting error:
ERROR Failed to compile with 1 errors 11:14:59 AM
error in ./node_modules/pdfjs-dist/build/pdf.worker.js
Module build failed: Error: Cannot find module 'webpack/lib/web/FetchCompileWasmTemplatePlugin'
Require stack:
- C:\xampp\htdocs\easy-portal\node_modules\worker-loader\dist\index.js
- C:\xampp\htdocs\easy-portal\node_modules\worker-loader\dist\cjs.js
- C:\xampp\htdocs\easy-portal\node_modules\loader-runner\lib\loadLoader.js
- C:\xampp\htdocs\easy-portal\node_modules\loader-runner\lib\LoaderRunner.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack\lib\NormalModule.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack\lib\NormalModuleFactory.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack\lib\Compiler.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack\lib\webpack.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack-dev-server\lib\Server.js
- C:\xampp\htdocs\easy-portal\node_modules\webpack-dev-server\bin\webpack-dev-server.js
here is my package.json file:
{
"name": "app",
"version": "1.0.0",
"description": "ATS System",
"author": "N4TECH",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "node server.js",
"build:dev": "node build/dev.js",
"build:prod": "node build/build.js"
},
"dependencies": {
"axios": "^0.17.1",
"bootstrap": "^3.3.7",
"bootstrap-vue": "^1.4.0",
"chalk": "^2.0.1",
"css-loader": "^0.28.8",
"debounce": "^1.1.0",
"express": "^4.16.3",
"express-static-gzip": "^0.3.2",
"jquery": "^3.3.1",
"lodash": "^4.17.5",
"moment": "^2.20.1",
"node-sass": "^4.7.2",
"pusher-js": "^4.3.1",
"raw-loader": "^0.5.1",
"sass-loader": "^6.0.6",
"tributejs": "^3.5.3",
"vee-validate": "^2.0.0-beta.17",
"vue": "^2.5.2",
"vue-clipboard2": "^0.3.1",
"vue-html5-editor": "^1.1.1",
"vue-i18n": "^8.1.0",
"vue-pdf": "^3.2.0",
"vue-router": "^3.0.1",
"vue-scrollto": "^2.11.0",
"vue-social-sharing": "^2.3.3",
"vue-style-loader": "^3.0.3",
"vue-truncate-collapsed": "^1.3.0",
"vue2-datatable-component": "^2.1.26",
"vuedraggable": "^2.16.0",
"vuetify": "^1.2.4",
"vuex": "^3.0.1",
"vuex-persistedstate": "^2.4.2"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.1",
"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",
"chalk": "^2.0.1",
"compression-webpack-plugin": "^1.1.6",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.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",
"node-notifier": "^5.1.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0",
"worker-loader": "^3.0.7"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
Any help would be highly appreciable.
I fixed it by update webpack to webpack5
Related
every time I try to launch the generate for my nuxt project on gitlab, I get back for every page generated a strange error,
[error] /Dashboard
TypeError: external_defu_ is not a function
at server.js:12669:45
at Array.reduce (<anonymous>)
at new runtime_BaseScheme (node_modules/#nuxtjs/auth-next/dist/runtime.mjs:883:0)
at new runtime_Oauth2Scheme (node_modules/#nuxtjs/auth-next/dist/runtime.mjs:1137:0)
at auth (node_modules/.cache/nuxt/auth.js:45:0)
at createApp (node_modules/.cache/nuxt/index.js:291:0)
at runNextTicks (node:internal/process/task_queues:61:5)
at listOnTimeout (node:internal/timers:526:9)
at processTimers (node:internal/timers:500:7)
at async module.exports.__webpack_exports__.default (node_modules/.cache/nuxt/server.js:85:0)
This prevents the page from generating itself correctly.
While if I launch the project locally, with the same version of node, it generates everything correctly.
Do you know how I can solve the problem?
In gitlab's docker I'm using node v12.16.3.
This is my package.json
{
"name": "xxx",
"version": "1.0.0",
"description": "xxx",
"author": "Alessandro",
"private": true,
"scripts": {
"generate": "ENV=production nuxt generate",
generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore ."
},
"dependencies": {
"#nuxtjs/auth": "^4.9.1",
"#nuxtjs/auth-next": "5.0.0-1613647907.37b1156",
"#nuxtjs/axios": "^5.13.1",
"#nuxtjs/pwa": "^3.3.4",
"#vue/composition-api": "^0.6.7",
"aws-sdk": "^2.610.0",
"axios": "^0.21.1",
"bcryptjs": "^2.4.3",
"browser-image-compression": "^1.0.14",
"caniuse-lite": "^1.0.30001257",
"chart.js": "^2.9.3",
"child_process": "^1.0.2",
"compass": "^0.1.1",
"cookie": "^0.4.0",
"cookie-universal-nuxt": "^2.1.4",
"cors": "^2.8.5",
"cross-fetch": "^3.1.5",
"file-saver": "^2.0.2",
"fs": "0.0.1-security",
"gapi-script": "^1.2.0",
"install": "^0.13.0",
"js-cookie": "^2.2.1",
"kaleidoscopejs": "1.0.18",
"leaflet": "^1.6.0",
"lodash": "^4.17.15",
"md5": "^2.2.1",
"moment": "^2.29.3",
"multer": "^1.4.2",
"net": "^1.0.2",
"node-fetch": "^2.6.7",
"node-orientdb-http": "^0.1.1",
"npm": "^8.13.1",
"nuxt": "^2.15.0",
"nuxt-gmaps": "^1.2.10",
"nuxt-i18n": "^6.3.0",
"nuxt-leaflet": "0.0.19",
"nuxt-sass-resources-loader": "^2.0.5",
"p-iteration": "^1.1.8",
"pannellum": "github:saidmoya12/pannellum",
"panolens": "^0.12.1",
"proxy": "^1.0.2",
"readline": "^1.3.0",
"simple-analytics-vue": "^1.1.5",
"tls": "0.0.1",
"videojs": "^1.0.0",
"videojs-panorama": "^0.1.7",
"vue": "2.6.14",
"vue-chartjs": "^3.5.0",
"vue-cookie-accept-decline": "^5.3.1",
"vue-expandable-image": "^0.1.0",
"vue-google-login": "^2.0.3",
"vue-pannellum": "^0.5.3",
"vue-plausible": "^1.2.1",
"vue-rangedate-picker": "^1.0.0",
"vue-rangedate-picker-winslow": "^1.0.8",
"vue-server-renderer": "^2.6.12",
"vue-template-compiler": "^2.6.12",
"vue-tooltipster": "^1.2.0",
"vue-upload-multiple-image": "^1.1.4",
"vue2-google-maps": "^0.10.7",
"vue2-leaflet": "^2.6.0",
"vuedraggable": "^2.23.2",
"vuejs-panorama": "^1.1.9",
"vuejs-vr": "^1.2.2",
"vuetify": "^2.5.12",
"vuex-persistedstate": "^3.0.1",
"webpack": "^4.45.0"
},
"devDependencies": {
"#aceforth/nuxt-optimized-images": "^1.4.0",
"#nuxt/bridge": "npm:#nuxt/bridge-edge#^3.0.0-27268729.5b8e10f",
"#nuxt/image": "^0.7.1",
"#nuxt/types": "^2.14.12",
"#nuxtjs/dotenv": "^1.4.1",
"#nuxtjs/eslint-config": "^3.1.0",
"#nuxtjs/eslint-module": "^2.0.0",
"#nuxtjs/google-analytics": "^2.4.0",
"#nuxtjs/vuetify": "^1.12.3",
"babel-eslint": "^10.0.1",
"eslint": "^7.5.0",
"eslint-plugin-nuxt": ">=0.4.2",
"imagemin-gifsicle": "^7.0.0",
"imagemin-mozjpeg": "^9.0.0",
"imagemin-pngquant": "^9.0.2",
"imagemin-svgo": "^9.0.0",
"lqip-loader": "^2.2.1",
"responsive-loader": "^2.3.0",
"rimraf": "^3.0.2",
"sharp": "^0.30.7",
"sqip-loader": "^1.0.0",
"webp-loader": "^0.6.0"
}
}
Thank you very much
Alessandro
I also had this issue on Nuxt2 Bridge using #nuxtjs/auth-next. The solution is to transpile defu during the build:
nuxt.config.js
export default defineNuxtConfig({
// ...
build: {
transpile: [
'defu',
],
},
})
The issue and possible solutions are described in the docs: https://v3.nuxtjs.org/guide/going-further/esm/
When running npm run build or nom run dev. the following error is produced.
ERROR in ./src/components/screens/login/login.js?vue&type=script&lang=js& (./node_modules/babel-loader/lib!./node_modules/eslint-loader??ref--0!./src/components/screens/login/login.js?vue&type=script&lang=js&)
Module not found: Error: Can't resolve 'Vue' in '/home/builder/build/release/projects/appschoolware/9.9.5/build/src/components/screens/login'
# ./src/components/screens/login/login.js?vue&type=script&lang=js& (./node_modules/babel-loader/lib!./node_modules/eslint-loader??ref--0!./src/components/screens/login/login.js?vue&type=script&lang=js&) 22:0-22 391:45-48
dont really understand, the reason for this..hope anyone can help.
My package.json is long so bear with me.
"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",
"test": "npm run unit",
"lint": "eslint --ext .js,.vue src test/unit",
"build": "node --max_old_space_size=1024 build/build.js"
},
"dependencies": {
"rrule": "^2.6.8",
"#babel/polyfill": "^7.8.3",
"#riophae/vue-treeselect": "^0.4.0",
"axios": "^0.18.1",
"babel-polyfill": "^6.26.0",
"expr-eval": "^1.2.3",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"flat": "^5.0.2",
"gradle": "^1.2.3",
"jquery": "^3.5.1",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"qrcode.vue": "^1.7.0",
"save": "^2.4.0",
"v-tooltip": "^2.0.3",
"vue": "^2.6.11",
"vue-autosuggest": "^2.0.4",
"vue-axios": "^2.1.5",
"vue-ctk-date-time-picker": "^2.4.0",
"vue-infinite-loading": "^2.4.4",
"vue-print-nb": "^1.5.0",
"vue-qrcode-reader": "^2.1.1",
"vue-radial-menu": "^1.1.1",
"vue-router": "^3.1.5",
"vue-select": "^2.6.4",
"vue-swatches": "^1.0.4",
"vue-sweetalert2": "^1.2.4",
"vue-the-mask": "^0.11.1",
"vue-touch": "^2.0.0-beta.4",
"vue2-editor": "^2.10.2",
"vue2-filters": "^0.11.0",
"vue2-touch-events": "^2.1.0",
"vuejs-datepicker": "^1.6.2",
"vuex": "^3.1.2"
},
"devDependencies": {
"#babel/cli": "^7.8.3",
"#babel/core": "^7.8.3",
"#babel/plugin-transform-function-name": "^7.8.3",
"#babel/preset-env": "^7.8.3",
"#vue/babel-preset-app": "^4.1.2",
"autoprefixer": "^9.7.4",
"babel-cli": "^6.26.0",
"babel-core": "^6.22.1",
"babel-eslint": "^10.0.3",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-loader": "^7.1.5",
"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.7.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-latest": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"babel-preset-vue": "^2.0.2",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^2.1.1",
"eslint": "^5.16.0",
"eslint-config-standard": "^12.0.0",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^2.2.1",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^5.2.3",
"eventsource-polyfill": "^0.9.6",
"file-loader": "^3.0.1",
"friendly-errors-webpack-plugin": "^1.6.1",
"html-webpack-plugin": "^3.2.0",
"inject-loader": "^4.0.1",
"karma": "^4.4.1",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-phantomjs-shim": "^1.4.0",
"karma-sinon-chai": "^2.0.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.32",
"karma-webpack": "^3.0.5",
"mini-css-extract-plugin": "^0.5.0",
"mocha": "^5.2.0",
"node-notifier": "^5.4.3",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"ora": "^3.4.0",
"phantomjs-prebuilt": "^2.1.14",
"portfinder": "^1.0.25",
"postcss-loader": "^3.0.0",
"rimraf": "^2.7.1",
"semver": "^5.7.1",
"shelljs": "^0.8.3",
"sinon": "^7.5.0",
"sinon-chai": "^3.4.0",
"transfer-webpack-plugin": "^0.1.4",
"uglifyjs-webpack-plugin": "^2.2.0",
"url-loader": "^1.1.2",
"vue-hot-reload-api": "^2.3.4",
"vue-loader": "^15.8.3",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.11",
"webpack": "^4.41.5",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.11.0",
"webpack-emit-all-plugin": "^2.0.1",
"webpack-merge": "^4.2.2"
},
"engines": {
"node": ">=12.13.0 <13.0.0",
"npm": ">= 6.12.0"
As you see in the file login.js there is a single line "import Vue from 'Vue' " and thats i think throwing the error..but in my localhost i dont see any issues.
import Vue from 'vue' was the solution...Capital letters matter!!! careful!
I'm very new and I'm trying to stick to the steps followed by an instructor in Coursera. And I get an error after doing several steps and trying to run lite-server with npm run dev command in CMD:
C:\Users\Spifet\Documents\guia-hoteles>npm run dev
npm ERR! code EJSONPARSE
npm ERR! path C:\Users\Spifet\Documents\guia-hoteles/package.json
npm ERR! JSON.parse Unexpected string in JSON at position 5096 while parsing '{
npm ERR! JSON.parse "devDependencies": {
npm ERR! JSON.parse "lite-serve'
npm ERR! JSON.parse Failed to parse JSON data.
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Spifet\AppData\Local\npm-cache\_logs\2020-11-01T03_21_13_999Z-debug.log
This is how my package.json currently looks like:
{
"devDependencies": {
"lite-server": "^2.5.4"
},
"name": "guia-hoteles",
"version": "1.0.0",
"main": "index.js",
"dependencies": {
"after": "^0.8.2",
"arraybuffer.slice": "^0.0.7",
"accepts": "^1.3.7",
"anymatch": "^3.1.1",
"async": "^1.5.2",
"async-each-series": "^0.1.1",
"ansi-regex": "^2.1.1",
"backo2": "^1.0.2",
"async-limiter": "^1.0.1",
"ansi-styles": "^2.2.1",
"base64id": "^1.0.0",
"batch": "^0.6.1",
"better-assert": "^1.0.2",
"balanced-match": "^1.0.0",
"binary-extensions": "^2.1.0",
"axios": "^0.19.0",
"blob": "^0.0.5",
"brace-expansion": "^1.1.11",
"base64-arraybuffer": "^0.1.5",
"braces": "^3.0.2",
"browser-sync": "^2.26.13",
"browser-sync-client": "^2.26.13",
"browser-sync-ui": "^2.26.13",
"bs-recipes": "^1.3.4",
"callsite": "^1.0.0",
"camelcase": "^5.3.1",
"bytes": "^3.1.0",
"bs-snippet-injector": "^2.0.1",
"color-name": "^1.1.3",
"cliui": "^6.0.0",
"color-convert": "^1.9.3",
"component-bind": "^1.0.0",
"component-inherit": "^0.0.3",
"commander": "^2.20.3",
"component-emitter": "^1.3.0",
"chokidar": "^3.4.3",
"concat-map": "^0.0.1",
"connect": "^3.6.6",
"connect-logger": "^0.0.1",
"cookie": "^0.3.1",
"debug": "^2.6.9",
"depd": "^1.1.2",
"connect-history-api-fallback": "^1.6.0",
"dev-ip": "^1.0.1",
"destroy": "^1.0.4",
"chalk": "^1.1.3",
"decamelize": "^1.2.0",
"dlv": "^1.1.3",
"eazy-logger": "^3.1.0",
"emoji-regex": "^8.0.0",
"ee-first": "^1.1.1",
"escape-html": "^1.0.3",
"easy-extender": "^2.3.4",
"engine.io": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"engine.io-client": "^3.4.4",
"etag": "^1.8.1",
"encodeurl": "^1.0.2",
"finalhandler": "^1.1.0",
"engine.io-parser": "^2.1.3",
"fill-range": "^7.0.1",
"fresh": "^0.5.2",
"eventemitter3": "^4.0.7",
"follow-redirects": "^1.13.0",
"get-caller-file": "^2.0.5",
"find-up": "^4.1.0",
"glob-parent": "^5.1.1",
"fsevents": "^2.1.3",
"has-ansi": "^2.0.0",
"has-binary2": "^1.0.3",
"fs-extra": "^3.0.1",
"graceful-fs": "^4.2.4",
"immutable": "^3.8.2",
"http-proxy": "^1.18.1",
"iconv-lite": "^0.4.24",
"indexof": "^0.0.1",
"inherits": "^2.0.4",
"is-binary-path": "^2.1.0",
"http-errors": "^1.7.3",
"is-extglob": "^2.1.1",
"is-number": "^7.0.0",
"is-buffer": "^2.0.4",
"is-glob": "^4.0.1",
"is-fullwidth-code-point": "^3.0.0",
"has-cors": "^1.1.0",
"is-number-like": "^1.0.8",
"is-wsl": "^1.1.0",
"jsonfile": "^3.0.1",
"locate-path": "^5.0.0",
"limiter": "^1.1.5",
"localtunnel": "^2.0.0",
"lodash.isfinite": "^3.3.2",
"mime": "^1.4.1",
"mime-db": "^1.44.0",
"micromatch": "^4.0.2",
"isarray": "^2.0.1",
"minimatch": "^3.0.4",
"mime-types": "^2.1.27",
"mitt": "^1.2.0",
"object-component": "^0.0.3",
"ms": "^2.0.0",
"normalize-path": "^3.0.0",
"openurl": "^1.1.1",
"on-finished": "^2.3.0",
"negotiator": "^0.6.2",
"opn": "^5.3.0",
"p-locate": "^4.1.0",
"parseqs": "^0.0.6",
"parseuri": "^0.0.6",
"parseurl": "^1.3.3",
"p-try": "^2.2.0",
"p-limit": "^2.3.0",
"picomatch": "^2.2.2",
"path-exists": "^4.0.0",
"minimist": "^1.2.0",
"qs": "^6.2.3",
"portscanner": "^2.1.1",
"range-parser": "^1.2.1",
"readdirp": "^3.5.0",
"raw-body": "^2.4.1",
"resp-modifier": "^6.0.2",
"requires-port": "^1.0.0",
"require-main-filename": "^2.0.0",
"rx": "^4.1.0",
"require-directory": "^2.1.1",
"rxjs": "^5.5.12",
"serve-index": "^1.9.1",
"safer-buffer": "^2.1.2",
"send": "^0.16.2",
"serve-static": "^1.13.2",
"server-destroy": "^1.0.1",
"safe-buffer": "^5.1.2",
"socket.io-adapter": "^1.1.2",
"socket.io": "^2.1.1",
"socket.io-parser": "^3.2.0",
"setprototypeof": "^1.1.1",
"statuses": "^1.3.1",
"strip-ansi": "^3.0.1",
"stream-throttle": "^0.1.3",
"socket.io-client": "^2.3.1",
"supports-color": "^2.0.0",
"symbol-observable": "^1.0.1",
"string-width": "^4.2.0",
"set-blocking": "^2.0.0",
"toidentifier": "^1.0.0",
"to-regex-range": "^5.0.1",
"tfunk": "^4.0.0",
"to-array": "^0.1.4",
"unpipe": "^1.0.0",
"ua-parser-js": "^0.7.22",
"universalify": "^0.1.2",
"ultron": "^1.1.1",
"utils-merge": "^1.0.1",
"which-module": "^2.0.0",
"wrap-ansi": "^6.2.0",
"ws": "^3.3.3",
"yargs-parser": "^18.1.3",
"y18n": "^4.0.0",
"yeast": "^0.1.2",
"lodash": "^4.17.20",
"xmlhttprequest-ssl": "^1.5.5",
"moment": "^2.29.1",
"yargs": "^15.4.1"
},
"scripts": {
"dev" : "lite-server",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://Spifet#bitbucket.org/Spifet/guia-hoteles.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"homepage": "https://bitbucket.org/Spifet/guia-hoteles"
"description": ""
}
Could anyone please tell me how to fix it?
Thanks in advance!
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"
]
I have the following simple test in a t.test.js file in my React repo
test('sum', () => {
expect(1+1).toBe(3);
});
I followed the steps to set up Jest using the official guide.
However, when I run npm test, nothing happens. This is the output I get before Jest exits:
> # test
> jest
Using Jest CLI v0.8.2, jasmine1
What could be the problem? No tests are being run in my repository. Here is a dump of my package.json if necessary:
{
"private": true,
"engines": {
"node": ">=5.0 <6",
"npm": ">=3.3 <4"
},
"dependencies": {
"#google/maps": "^0.4.5",
"auth0-lock": "^10.24.3",
"autosuggest-highlight": "^3.1.1",
"aws-sdk": "^2.202.0",
"babel-polyfill": "6.9.1",
"babel-runtime": "6.9.2",
"bluebird": "3.1.1",
"body-parser": "^1.18.2",
"classnames": "2.2.1",
"cookie-parser": "^1.4.3",
"cors": "^2.8.3",
"cron": "^1.3.0",
"dotenv": "^2.0.0",
"downloadjs": "^1.4.7",
"eventemitter3": "1.1.1",
"express": "4.13.3",
"express-formidable": "^1.0.0",
"express-jwt": "^5.1.0",
"fastclick": "1.0.6",
"fbjs": "0.5.1",
"fetch-jsonp": "^1.1.3",
"flux": "2.1.1",
"formsy-react": "^0.19.5",
"front-matter": "2.0.1",
"fuse.js": "^2.5.0",
"google-libphonenumber": "^3.0.12",
"google-map-react": "^0.27.0",
"google-maps-react": "^1.1.2",
"history": "1.16.0",
"intercom-client": "^2.9.2",
"isomorphic-style-loader": "^4.0.0",
"jade": "1.11.0",
"json-loader": "^0.5.7",
"mailchimp-api-v3": "^1.8.0",
"markdown": "^0.5.0",
"mixpanel": "^0.8.0",
"mixpanel-browser": "^2.17.1",
"moment": "^2.20.1",
"moment-timezone": "^0.5.14",
"mongodb": "2.1.7",
"morgan": "^1.9.0",
"node-fetch": "1.3.3",
"normalize.css": "3.0.3",
"passport-auth0": "^0.6.1",
"passport-http": "^0.3.0",
"rc-progress": "^2.2.5",
"react": "^0.14.9",
"react-addons-create-fragment": "^0.14.8",
"react-autosuggest": "^9.3.4",
"react-day-picker": "^2.4.0",
"react-dom": "^0.14.9",
"react-redux": "^4.4.1",
"react-routing": "0.0.6",
"react-scrollable-anchor": "^0.5.0",
"react-share": "^1.19.1",
"react-stripe-checkout": "^1.8.0",
"redux": "^3.3.1",
"sendgrid": "^2.0.0",
"source-map-support": "0.4.0",
"stripe": "^4.25.0",
"tempy": "^0.2.1",
"twilio": "^2.9.1",
"twitter": "^1.7.0",
"underscore": "^1.8.3",
"whatwg-fetch": "0.10.1",
"xhr2": "^0.1.3"
},
"devDependencies": {
"assets-webpack-plugin": "^3.4.0",
"autoprefixer": "^6.1.2",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-eslint": "^6.0.4",
"babel-jest": "^22.4.1",
"babel-loader": "^6.2.4",
"babel-plugin-react-transform": "^2.0.2",
"babel-plugin-rewire": "^1.0.0-rc-3",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-react-constant-elements": "^6.8.0",
"babel-plugin-transform-react-inline-elements": "^6.8.0",
"babel-plugin-transform-react-remove-prop-types": "^0.2.7",
"babel-plugin-transform-runtime": "^6.9.0",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015": "^6.9.0",
"babel-preset-node5": "^11.1.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.26.0",
"babel-template": "^6.26.0",
"babel-types": "^6.26.0",
"browser-sync": "^2.23.6",
"css-loader": "^0.28.10",
"csscomb": "^3.1.8",
"del": "^2.2.0",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^2.1.1",
"eslint-loader": "^1.1.1",
"eslint-plugin-react": "^3.11.3",
"extend": "^3.0.0",
"file-loader": "^0.8.5",
"gaze": "^0.5.2",
"git-repository": "^0.1.1",
"glob": "^6.0.1",
"jest": "^22.4.2",
"jest-cli": "^0.8.2",
"jscs": "^2.7.0",
"mkdirp": "^0.5.1",
"ncp": "^2.0.0",
"postcss": "^5.2.18",
"postcss-import": "^7.1.3",
"postcss-loader": "^0.8.0",
"precss": "^1.3.0",
"react-test-renderer": "^16.2.0",
"react-transform-catch-errors": "^1.0.0",
"react-transform-hmr": "^1.0.1",
"redbox-react": "1.2.0",
"replace": "^0.3.0",
"superagent": "^3.8.2",
"supertest": "^3.0.0",
"url-loader": "^0.5.7",
"webpack": "^1.13.0",
"webpack-hot-middleware": "^2.21.0",
"webpack-middleware": "^1.5.1",
"webpack-node-externals": "^1.6.0"
},
"babel": {
"presets": [
"react",
"node5",
"stage-0"
],
"env": {
"test": {
"plugins": [
"rewire"
]
}
},
"plugins": [
"transform-class-properties"
]
},
"jest": {
"rootDir": "./src"
},
"scripts": {
"lint": "eslint src tools && jscs src tools",
"csslint": "csscomb src/components --lint --verbose",
"csscomb": "csscomb src/components --verbose",
"test": "jest",
"clean": "babel-node tools/run clean",
"copy": "babel-node tools/run copy",
"bundle": "babel-node tools/run bundle",
"build": "babel-node tools/run build",
"deploy": "babel-node tools/run deploy",
"start": "babel-node tools/run start"
}
}