Cannot read property 'emit' of null on Npm install - node.js

Npm install is failing with this error Cannot read property 'emit' of null on executing npm install command
Here are the Dependencies
"devDependencies": {
"babel-core": "^6.7.4",
"babel-eslint": "^6.0.0",
"babel-loader": "^6.2.4",
"babel-plugin-transform-object-assign": "^6.5.0",
"babel-plugin-transform-object-rest-spread": "^6.5.0",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"bootstrap-loader": "^1.0.10",
"bootstrap-sass": "^3.3.6",
"chai": "^3.5.0",
"chai-enzyme": "^0.4.1",
"classnames": "^2.2.3",
"copyfiles": "^0.2.1",
"css-loader": "^0.23.0",
"enzyme": "^2.2.0",
"es6-promise": "^3.1.2",
"eslint": "^2.7.0",
"eslint-config-airbnb": "^6.2.0",
"eslint-loader": "^1.3.0",
"eslint-plugin-jsx-control-statements": "^1.1.0",
"eslint-plugin-react": "^4.3.0",
"extract-text-webpack-plugin": "^1.0.0",
"fetch-mock": "^4.3.0",
"file-loader": "^0.8.4",
"font-awesome": "^4.5.0",
"fs": "0.0.2",
"glob": "^7.0.3",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.10",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-compress": "^1.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-webpack": "^1.0.11",
"handlebars": "^4.0.5",
"immutable": "^3.7.6",
"isparta-instrumenter-loader": "^1.0.0",
"json-loader": "^0.5.4",
"jsonpath-plus": "^0.15.0",
"jsx-control-statements": "^3.1.0",
"karma": "^0.13.22",
"karma-chai": "^0.1.0",
"karma-coverage": "^0.5.5",
"karma-jsdom-launcher": "^3.0.0",
"karma-mocha": "^0.2.2",
"karma-mocha-reporter": "^2.0.0",
"karma-osx-reporter": "^0.2.1",
"karma-phantomjs-launcher": "^1.0.0",
"karma-phantomjs-shim": "^1.1.1",
"karma-sourcemap-loader": "^0.3.5",
"karma-webpack": "^1.7.0",
"marked": "^0.3.5",
"mocha": "^2.4.5",
"node-sass": "^3.4.2",
"null-loader": "^0.1.1",
"open": "0.0.5",
"phantomjs-prebuilt": "^2.1.7",
"pluralize": "^1.2.1",
"pm2": "^3.5.1",
"postcss": "^5.0.19",
"postcss-loader": "^0.8.2",
"react-addons-css-transition-group": "^0.14.7",
"react-addons-pure-render-mixin": "^0.14.8",
"react-addons-test-utils": "^0.14.8",
"react-autosize-textarea": "^0.3.4",
"react-bootstrap": "^0.28.5",
"react-cookie": "^0.4.5",
"react-datagrid": "^2.0.2",
"react-hot-loader": "^1.2.9",
"react-mixin": "^3.0.4",
"react-overlays": "^0.6.1",
"react-router": "^2.0.1",
"react-router-redux": "^4.0.0",
"react-tabs": "^0.5.3",
"react-textarea-autosize": "^4.0.5",
"redux-act": "^0.4.0",
"redux-logger": "^2.6.0",
"redux-thunk": "^2.0.1",
"resolve-url-loader": "^1.4.3",
"rimraf": "^2.5.2",
"sass-loader": "^3.2.0",
"sass-resources-loader": "^1.0.2",
"sinon": "^2.0.0-pre",
"skin-deep": "^0.16.0",
"sorty": "^1.2.0",
"style-loader": "^0.13.1",
"url-loader": "^0.5.6",
"velocity-react": "^1.1.4",
"webpack": "^1.12.14",
"webpack-dev-middleware": "^1.6.1",
"webpack-dev-server": "^1.12.0",
"webpack-hot-middleware": "^2.10.0",
"webpack-sources": "^0.1.1",
"whatwg-fetch": "^0.11.0"
},
"dependencies": {
"async": "^1.5.2",
"bluebird": "^3.5.4",
"body-parser": "^1.15.0",
"compression": "^1.6.2",
"config": "^1.19.0",
"connect": "^3.4.1",
"connect-flash": "^0.1.1",
"connect-redis": "^3.0.2",
"cookie-parser": "^1.4.1",
"core-js": "^2.2.1",
"debug": "^2.2.0",
"elasticsearch": "^11.0.1",
"express": "^4.14.0",
"express-session": "^1.13.0",
"express-winston": "^1.4.1",
"form-data": "^2.1.2",
"jade": "^1.11.0",
"lodash": "^4.6.1",
"minimist": "^1.2.0",
"moment": "^2.12.0",
"newrelic": "^1.26.0",
"node-cache": "4.1.1",
"node-uuid": "^1.4.7",
"normalize.css": "^3.0.3",
"numeral": "^1.5.3",
"passport": "^0.4.1",
"passport-azure-ad": "^3.0.0",
"passport-saml": "^1.3.3",
"react": "^0.14.8",
"react-dom": "^0.14.8",
"react-redux": "^4.4.1",
"redis": "^2.6.1",
"redux": "^3.3.1",
"request": "^2.69.0",
"request-id": "^0.11.0",
"winston": "^2.2.0",
"winston-graylog2": "^0.5.0",
"wkhtmltopdf": "^0.3.0"
}
}
In error logs it shows error at TLSSocket.connectionErrorHandler. Below provided are the detail Error logs
npm verb stack TypeError: Cannot read property 'emit' of null
npm verb stack at TLSSocket.connectionErrorHandler
(C:\Users\bakhil\AppData\Roaming\nvm\v5.11.1\node_modules\npm\node_modules\request\request.js:82:24)
npm verb stack at TLSSocket.g (events.js:273:16)
npm verb stack at emitOne (events.js:95:20)
npm verb stack at TLSSocket.emit (events.js:182:7)
npm verb stack at emitErrorNT (net.js:1265:8)
npm verb stack at _combinedTickCallback (internal/process/next_tick.js:74:11)
npm verb stack at process._tickCallback (internal/process/next_tick.js:98:9)
Versions
Node: v5.11.1
NPM: v3.8.6
Please help me to resolve this error. Spend more than 1 day on this error and not able to figure it out.
Thanks in advance

Related

running npm run build throws Error: Can't resolve 'Vue'

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!

How to fix “Npm ERR! JSON.parse Unexpected string in JSON at position 5096”

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!

Node Sass does not yet support your current environment: Vuetify upgrade fails

I'm trying to upgrade Vuetify 1.5.+ to 2.0.+ but facing some issues while adding node-sass library. Initially when I installed sass-loader": "^8.0.0" it showing some syntax error as follows.
So in order to fix the issue, I just downgraded sass-loader from 8.+ to 7.+ after that it throwing some other issue as follows.
After that, I just tried different versions and all showing the same issue and within the link its shows as supported - https://github.com/sass/node-sass/releases/tag/v4.9.4(OSX and node version 10). Even I'd tried different node version and nothing seems to be working.
Current node version : v10.16.3
package.json :
{
/***.. ................ other details ******/
"dependencies": {
"#mdi/font": "^3.5.95",
"#nuxtjs/axios": "^5.3.6",
"#nuxtjs/pwa": "^2.6.0",
"await-to-js": "^2.1.1",
"boxen": "^3.1.0",
"cli-table": "^0.3.1",
"colors": "^1.3.3",
"commander": "^2.19.0",
"cross-env": "^5.2.0",
"debug": "^4.1.1",
"emittery": "^0.4.1",
"express": "^4.16.4",
"fast-levenshtein": "^2.0.6",
"glob": "^7.1.3",
"jsonfile": "^5.0.0",
"knex": "^0.19.2",
"lodash": "^4.17.11",
"material-design-icons": "^3.0.1",
"mkdirp": "^0.5.1",
"moment": "^2.24.0",
"monaco-editor": "^0.16.2",
"monaco-editor-webpack-plugin": "^1.7.0",
"monaco-themes": "^0.2.5",
"mssql": "^5.0.5",
"mysql": "^2.16.0",
"nano-assign": "^1.0.1",
"nodemailer": "^6.3.0",
"nuxt": "^2.8.1",
"nuxt-material-design-icons": "^1.0.4",
"oracledb": "^3.1.2",
"pg": "^7.9.0",
"pify": "^4.0.1",
"popper.js": "^1.14.7",
"rmdir": "^1.2.0",
"sql-formatter": "^2.3.2",
"sqlite3": "^4.0.8",
"stripe": "^6.32.0",
"tcp-port-used": "^1.0.1",
"v-hotkey": "^0.3.1",
"vee-validate": "^2.2.0",
"vue": "^2.6.10",
"vue-click-outside": "^1.0.7",
"vue-drag-resize": "^1.3.2",
"vue-draggable-resizable": "^2.0.0-rc1",
"vue-monaco": "^0.3.1",
"vue-recaptcha": "^1.1.1",
"vue-shortcuts": "^1.1.2",
"vue-shortkey": "^3.1.7",
"vue-stripe-elements-plus": "^0.2.9",
"vuetify": "^2.0.18",
"vuetify-loader": "^1.2.1",
"vuex-persistedstate": "^2.5.4"
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"chai": "^4.2.0",
"chokidar": "^2.1.5",
"cross-env": "^5.1.4",
"deepmerge": "^4.0.0",
"devtron": "^1.4.0",
"electron": "^4.1.4",
"electron-builder": "^20.39.0",
"electron-devtools-installer": "^2.2.4",
"electron-renderer": "^2.0.4",
"eslint": "6.4.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-config-standard": ">=12.0.0",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^2.1.2",
"eslint-plugin-import": ">=2.16.0",
"eslint-plugin-jest": ">=22.3.0",
"eslint-plugin-mocha": "^5.3.0",
"eslint-plugin-node": ">=8.0.1",
"eslint-plugin-nuxt": ">=0.4.2",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-promise": ">=4.0.1",
"eslint-plugin-standard": ">=4.0.0",
"eslint-plugin-vue": "^5.2.2",
"fibers": "^4.0.1",
"jsdoc": "^3.5.5",
"minami": "^1.2.3",
"mocha": "^6.0.2",
"node-sass": "4.9.4",
"nodemon": "^1.18.9",
"nyc": "^14.1.1",
"prettier": "^1.16.4",
"sass": "^1.22.12",
"sass-loader": "^7.1.0",
"should": "^13.2.3",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2"
}
}
I'd tried following things but nothing seems to be working.
Tried different versions and done npm rebuild node-sass
Cleared npm cache, removed node_modules and then npm install
I hope this will be helpful to you.
first, check version of sass & sass-loader library.
"devDependencies": {
"#vue/cli-plugin-babel": "^3.9.0",
"#vue/cli-plugin-eslint": "^3.9.0",
"#vue/cli-service": "^3.9.0",
"sass": "^1.18.0",
"sass-loader": "^7.1.0",
"deepmerge": "^4.0.0"
}
second, check your syntax loaderOptions and chainWebpack.
you have to use semicolon ; in SCSS rules
module.exports = {
css: {
loaderOptions: {
sass: {
data: `#import "~#/sass/main.scss"`,
},
},
},
chainWebpack: config => {
["vue-modules", "vue", "normal-modules", "normal"].forEach((match) => {
config.module.rule('scss').oneOf(match).use('sass-loader')
.tap(opt => Object.assign(opt, { data: `#import '~#/sass/main.scss';` }))
})
}
}

_.each throws error after npm update

Everything was running fine, before I run 'npm update' to push my code with latest libraries. Now I am getting error:
{ message: 'Method Map.prototype.has called on incompatible receiver #',
stack: 'TypeError: Method Map.prototype.has called on incompatible receiver #\n at Clone.has ()\n at get (/Users/myproject/node_modules/kareem/index.js:418:11)\n at Clone.Kareem.pre (/Users/myproject/node_modules/kareem/index.js:350:16)\n at Clone.Schema.pre (/Users/myproject/node_modules/mongoose/lib/schema.js:1135:20)\n at Schema.extend (/Users/myproject/node_modules/mongoose-schema-extend/index.js:73:15)\n at Object.createSchema (/Users/myproject/framework/nDatabase/bin/system.js:341:89)\n at /Users/myproject/framework/nDatabase/bin/system.js:384:24\n at Array.forEach ()\n at Object.resolveSchemaDependancy (/Users/myproject/framework/nDatabase/bin/system.js:356:25)\n at /Users/myproject/framework/nDatabase/bin/system.js:406:24\n at /Users/myproject/node_modules/lodash/lodash.js:4917:15\n at baseForOwn (/Users/myproject/node_modules/lodash/lodash.js:3002:24)\n at /Users/myproject/node_modules/lodash/lodash.js:4886:18\n at Function.forEach (/Users/myproject/node_modules/lodash/lodash.js:9334:14)\n at Object.traverseSchemas (/Users/myproject/framework/nDatabase/bin/system.js:401:11)\n at Object.extractRawSchema (/Users/myproject/framework/nDatabase/bin/system.js:418:40)' }
Error indicate some issues with loadash library while using:
_.each({}, (object, name) =>{
/////
});
Here is list of dependancies I am using :
"dependencies": {
"async": "^2.6.1",
"bcrypt": "^1.0.3",
"body-parser": "^1.18.3",
"chai": "^4.1.2",
"cron": "^1.3.0",
"express": "^4.16.3",
"java": "^0.9.1",
"kafka-node": "^2.6.1",
"lodash": "^4.17.10",
"mocha": "^4.1.0",
"mocha-suit": "^0.5.3",
"mongodb": "^3.1.0-beta4",
"mongoose": "^5.1.6",
"mongoose-schema-extend": "0.2.0",
"node-cache": "^4.2.0",
"recursive-copy": "^2.0.8",
"redis": "^2.8.0",
"request-promise": "^4.2.2",
"should": "^13.2.1",
"stompit": "^0.25.0",
"uuid": "^3.2.1",
"winston": "^2.4.3",
"winston-daily-rotate-file": "^3.2.1",
"winston-elasticsearch": "^0.7.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-vue": "^2.0.2",
"babel-runtime": "^6.26.0",
"css-loader": "^0.28.11",
"meow": "^5.0.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"style-loader": "^0.21.0",
"webpack": "^4.12.0",
"webpack-dev-middleware": "^3.1.3"
}
Please help me to resolve this Issue.

"npm install" not doing anything despite there being a package.json

I'm not sure if it was because of upgrading npm or node, but "npm install" was working all along up till the upgrade, and after struggling with this issue, decided to reverted back to using NodeJs v4.2.6 and npm v2.14.18 - still though, this hasn't resolved the issue. When removing my node_modules folder and then running "npm install", it does nothing as can be seen below:
This is my package.json
{
"private": true,
"jspm": {
"dependencies": {
"angular": "github:angular/bower-angular#^1.4.7",
"angular-animate": "github:angular/bower-angular-animate#^1.4.8",
"angular-bootstrap-contextmenu": "npm:angular-bootstrap-contextmenu#^0.9.6",
"angular-loading-bar": "github:chieffancypants/angular-loading-bar#^0.8.0",
"angular-local-storage": "npm:angular-local-storage#^0.2.2",
"angular-messages": "github:angular/bower-angular-messages#^1.4.7",
"angular-mocks": "github:angular/bower-angular-mocks#^1.4.7",
"angular-ui-bootstrap": "npm:angular-ui-bootstrap#^0.14.0",
"angular-ui-grid": "github:angular-ui/bower-ui-grid#^3.0.7",
"angular-ui-router": "github:angular-ui/ui-router#^0.2.15",
"bootstrap": "github:twbs/bootstrap#^3.3.6",
"bootstrap-sass": "github:twbs/bootstrap-sass#^3.3.6",
"clean-css": "npm:clean-css#^3.4.9",
"font-awesome": "npm:font-awesome#^4.5.0",
"jquery": "github:components/jquery#2.1.3",
"json": "github:systemjs/plugin-json#^0.1.0",
"lodash": "npm:lodash#^3.10.1",
"moment": "github:moment/moment#^2.10.6",
"ngstorage": "npm:ngstorage#^0.3.9",
"restangular": "github:mgonto/restangular#^1.5.1",
"text": "github:systemjs/plugin-text#^0.0.2",
"toastr": "github:CodeSeven/toastr#^2.1.2"
},
"devDependencies": {
"babel": "npm:babel-core#^5.8.24",
"babel-runtime": "npm:babel-runtime#^5.8.24",
"core-js": "npm:core-js#^1.1.4"
}
},
"devDependencies": {
"babel": "^5.8.35",
"babel-core": "^5.8.35",
"babel-polyfill": "^6.3.14",
"babel-runtime": "^5.8.35",
"browser-sync": "^2.11.1",
"core-js": "^1.2.3",
"del": "^2.1.0",
"extend": "^3.0.0",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-changed": "^1.3.0",
"gulp-clean": "^0.3.1",
"gulp-cli": "^0.3.0",
"gulp-concat": "^2.6.0",
"gulp-filter": "^3.0.1",
"gulp-htmlhint": "^0.3.0",
"gulp-if": "^2.0.0",
"gulp-jshint": "^1.11.2",
"gulp-karma": "0.0.5",
"gulp-livereload": "^3.8.1",
"gulp-minify-css": "^1.2.2",
"gulp-notify": "^2.2.0",
"gulp-plumber": "^1.0.1",
"gulp-preprocess": "^2.0.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.5.4",
"gulp-sass": "^2.0.4",
"gulp-slash": "^1.1.3",
"gulp-sourcemaps": "^1.6.0",
"gulp-util": "^3.0.7",
"isparta": "^3.1.0",
"jasmine-async-sugar": "^1.3.0",
"jasmine-core": "^2.3.4",
"jshint-stylish": "^2.0.1",
"jspm": "^0.16.24",
"karma": "^0.13.14",
"karma-babel-preprocessor": "^5.2.2",
"karma-chrome-launcher": "^0.2.1",
"karma-cli": "^0.1.1",
"karma-coverage": "^0.5.2",
"karma-coveralls": "^1.1.2",
"karma-firefox-launcher": "^0.1.6",
"karma-ie-launcher": "^0.2.0",
"karma-jasmine": "^0.3.6",
"karma-jspm": "^2.0.1",
"karma-junit-reporter": "^0.3.7",
"karma-phantomjs-launcher": "^0.2.1",
"karma-safari-launcher": "^0.1.1",
"karma-vs-reporter": "^0.8.0",
"karma-xml-reporter": "^0.1.4",
"phantomjs": "^1.9.18",
"phantomjs-polyfill": "0.0.1",
"require-dir": "^0.3.0",
"run-sequence": "^1.1.5",
"systemjs-builder": "^0.14.11",
"ui-grid": "0.0.0",
"yargs": "^3.29.0"
}
}
Any ideas would be greatly appreciated. I've cleared my npm cache, but that hasn't helped.

Resources