npm install says cannot find file - javascript

I am cloning a repo and get the following error when running npm install
ENOENT:no such file or directory, rename '/Users/waston/Desktop/hm/STEMuli_MaterialUI/node_modules/.staging/client-6b05b6f7/node_modules/#babel/helper-module-imports' -> '/Users/waston/Desktop/hm/STEMuli_MaterialUI/node_modules/.staging/#babel/helper-module-imports-b86e8d76'
I thought maybe if I do npm install --save-dev #babel/helper-module-imports that may fix it, but even doing that gives me the same error.
package.json(server)
"dependencies": {
"azure-storage": "^2.10.2",
"bcryptjs": "^2.4.3",
"body-parser": "^1.18.2",
"cd": "^0.3.3",
"client": "file:client",
"concurrently": "^3.5.1",
"express": "^4.16.3",
"gravatar": "^1.6.0",
"install": "^0.12.2",
"into-stream": "^4.0.0",
"jsonwebtoken": "^8.2.0",
"mongoose": "^5.0.12",
"multer": "^1.4.1",
"multer-azure-storage": "^0.2.0",
"node-sass": "^4.10.0",
"npm": "^6.4.1",
"passport": "^0.4.0",
"passport-jwt": "^4.0.0",
"validator": "^9.4.1"
},
"scripts": {
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
}
Client package.json
"
dependencies": {
"#babel/runtime": "7.0.0-beta.55",
"#material-ui/core": "1.5.0",
"#material-ui/icons": "2.0.2",
"#types/googlemaps": "3.30.11",
"#types/markerclustererplus": "2.1.33",
"ajv": "6.5.2",
"axios": "^0.18.0",
"blueimp-file-upload": "^9.22.0",
"chartist": "0.10.1",
"cloudinary-jquery-file-upload": "^2.5.0",
"cloudinary-react": "^1.0.6",
"fullcalendar": "^3.0.0",
"fullcalendar-reactwrapper": "^1.0.7",
"fullcalendar-reactwrapper-scheduler": "^1.0.7",
"history": "4.7.2",
"install": "^0.12.2",
"jquery": "^3.3.1",
"jwt-decode": "^2.2.0",
"material-design-icons": "^3.0.1",
"moment": "^2.22.2",
"moment-timezone": "^0.5.21",
"node-sass-chokidar": "1.3.3",
"npm": "^6.4.1",
"npm-run-all": "4.1.3",
"perfect-scrollbar": "1.4.0",
"prop-types": "15.6.2",
"react": "^16.3.1",
"react-big-calendar": "^0.19.2",
"react-bootstrap": "^0.32.1",
"react-bootstrap-sweetalert": "4.4.1",
"react-chartist": "0.13.1",
"react-chat-widget": "^2.1.4-1",
"react-datetime": "2.15.0",
"react-dnd": "^5.0.0",
"react-dnd-html5-backend": "^5.0.1",
"react-dom": "^16.3.1",
"react-file-viewer": "^0.5.0",
"react-google-maps": "9.4.5",
"react-icons": "^3.0.5",
"react-jvectormap": "0.0.3",
"react-material-icons": "^1.0.3",
"react-moment": "^0.7.0",
"react-nouislider": "2.0.1",
"react-parallax": "^2.0.0",
"react-phone-number-input": "^2.2.14",
"react-player": "^1.6.6",
"react-redux": "^5.0.7",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.4",
"react-select": "^2.1.1",
"react-slick": "0.23.1",
"react-stepzilla": "^4.8.0",
"react-svg-icons": "^0.3.0",
"react-swipeable-views": "0.12.16",
"react-table": "6.8.6",
"react-tagsinput": "3.19.0",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
"socket.io-client": "^2.1.1",
"video-react": "^0.13.0"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-import-rename": "^1.0.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-es2015": "^6.24.1"
},
"optionalDependencies": {
"babel-eslint": "^7.2.3",
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.6.2",
"eslint-plugin-react": "^7.10.0",
"prettier": "^1.13.7"
},
"scripts": {
"build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"build": "npm run build-css && react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"lint:check": "eslint . --ext=js,jsx; exit 0",
"lint:fix": "eslint . --ext=js,jsx --fix; exit 0",
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
"build-package-css": "node-sass-chokidar src/materialComponents/assets/scss/material-kit-react.scss dist/material-kit-react.css",
"build-package": "npm run build-package-css && babel src --out-dir dist",
"deploy": "npm run build"
},

Delete your package-lock.json and the node_modules folder, then run npm install

Related

craco don't work with react-scripts#^5.0.1

it shows me this error:
yarn start  ✔  27s 
yarn run v1.22.19
$ craco start
Failed to compile.
For the selected environment is no default script chunk format available:
JSONP Array push can be chosen when 'document' or 'importScripts' is available.
CommonJs exports can be chosen when 'require' or node builtins are available.
Make sure that your 'browserslist' includes only platforms that support these features or select an appropriate 'target' to allow selecting a chunk format by default. Alternatively, specify the 'output.chunkFormat' directly.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
And this is my Package.json
{
"name": "fly-with-zoki",
"version": "1.10.0",
"private": true,
"main": "dist/index.js",
"dependencies": {
"#babel/helper-define-polyfill-provider": "^0.3.2",
"#date-io/date-fns": "^1.3.13",
"#emotion/react": "^11.10.5",
"#emotion/styled": "^11.10.5",
"#fontsource/roboto": "^4.5.8",
"#material-ui/core": "^4.12.4",
"#material-ui/icons": "4.11.2",
"#material-ui/lab": "^4.0.0-alpha.61",
"#material-ui/pickers": "^3.3.10",
"#mui/icons-material": "^5.10.16",
"#mui/lab": "^5.0.0-alpha.114",
"#mui/material": "^5.10.17",
"#mui/styled-engine-sc": "^5.10.16",
"#reduxjs/toolkit": "^1.8.0",
"#stripe/react-stripe-js": "^1.8.0-0",
"#stripe/stripe-js": "^1.29.0",
"#types/dotenv": "^8.2.0",
"amadeus": "^7.1.0",
"axios": "^0.27.1",
"bootstrap": "^4.6.1",
"chartist": "0.10.1",
"classnames": "2.3.1",
"date-fns": "^2.28.0",
"dom-lib": "^3.1.5",
"font-awesome": "^4.7.0",
"history": "5.0.0",
"jquery": "^3.6.0",
"json-schema-to-typescript": "^11.0.2",
"lib": "^4.3.3",
"material-ui-dropzone": "^3.5.0",
"moment": "^2.29.3",
"node": "^16.13.0",
"notistack": "^1.0.10",
"perfect-scrollbar": "1.5.1",
"popper.js": "^1.16.1",
"prop-types": "15.7.2",
"react": "^18.2.0",
"react-chartist": "0.14.4",
"react-dom": "17.0.2",
"react-image-gallery": "^1.2.8",
"react-moment": "^1.1.2",
"react-redux": "^7.2.8",
"react-responsive-carousel": "^3.2.23",
"react-router-dom": "5.2.0",
"react-scripts": "^5.0.1",
"react-select": "^5.3.2",
"react-swipeable-views": "^0.14.0",
"redux": "^4.1.2",
"redux-devtools-extension": "^2.13.9",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.4.1",
"styled-components": "^5.3.6"
},
"scripts": {
"lint": "eslint src",
"dev": "cross-env NODE_OPTIONS= next dev",
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject",
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
"lint:check": "eslint . --ext=js,jsx; exit 0",
"lint:fix": "eslint . --ext=js,jsx --fix; exit 0",
"build-package-css": "cp src/assets/css/material-dashboard-react.css dist/material-dashboard-react.css",
"build-package": "npm run build-package-css && babel src --out-dir dist"
},
"keywords": [],
"optionalDependencies": {
"#babel/core": "7.14.0",
"typescript": "4.2.4"
},
"devDependencies": {
"#babel/eslint-parser": "^7.19.1",
"#babel/preset-react": "^7.18.6",
"#craco/craco": "^7.0.0",
"autoprefixer": "^10.4.13",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"gulp": "4.0.2",
"gulp-append-prepend": "1.0.9",
"postcss": "^8.4.21",
"react-error-overlay": "6.0.9",
"tailwindcss": "npm:#tailwindcss/postcss7-compat#^2.2.17"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": []
},
"resolutions": {
"react-error-overlay": "6.0.9"
}
}
I have tried to upgrade my react-scripts by using
npm ugdate react-scripts
npm upgrade react-scripts
yarn update react-scripts
yarn upgrade react-scripts
But no changes were applied :(

I/chromium: [INFO:CONSOLE(2)] "Uncaught SyntaxError: Unexpected token ..." spread operator in webview android studio

the problem is maybe the same as the link below :
https://forum.vuejs.org/t/spread-operator-not-working-in-webview-android/74893/7
but the different is, im using laravel mix and vue 2.6.11
here is my package.json
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"build-report": "vue-cli-service build --report",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "rename .env .env_ && rename .env_ .env && php artisan ziggy:generate && cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js && rename .env .env.production && rename .env_ .env"
},
"devDependencies": {
"#babel/plugin-proposal-object-rest-spread": "^7.17.3",
"#fortawesome/fontawesome-free": "^5.12.0",
"#inertiajs/inertia": "^0.11.0",
"#inertiajs/inertia-vue": "^0.8.0",
"#inertiajs/progress": "^0.2.7",
"#mdi/font": "^4.9.95",
"#mdi/js": "^5.9.55",
"browser-sync": "^2.26.13",
"browser-sync-webpack-plugin": "^2.3.0",
"cross-env": "^7.0.3",
"deepmerge": "^4.2.2",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-vue": "^7.5.0",
"fibers": "^5.0.0",
"font-awesome": "^4.7.0",
"laravel-mix": "5.0.9",
"lodash": "^4.17.20",
"material-design-icons-iconfont": "^6.4.1",
"resolve-url-loader": "^3.1.2",
"roboto-fontface": "^0.10.0",
"sass": "^1.49.8",
"sass-loader": "^10.1.1",
"vue": "^2.6.11",
"vue-template-compiler": "^2.6.11",
"vuetify": "^2.4.2",
"vuetify-loader": "1.4.3"
},
"dependencies": {
"#chenfengyuan/vue-countdown": "^1.1.5",
"#mdi/light-font": "^0.2.63",
"#types/ziggy-js": "^0.9.0",
"#vue/cli-service": "^5.0.4",
"axios": "^0.21.1",
"dotenv": "^16.0.0",
"eslint": "^7.18.0",
"laravel-echo": "^1.10.0",
"lottie-player-vue": "0.0.16",
"object-to-formdata": "^4.1.0",
"pusher-js": "^7.0.2",
"qrcode": "^1.5.0",
"read-excel-file": "^5.2.28",
"sweetalert2": "^9.17.2",
"v-money": "^0.8.1",
"vee-validate": "^2.2.15",
"vform": "^1.0.1",
"vue-axios": "^2.1.5",
"vue-cli": "^2.9.6",
"vue-countdown": "^1.0.4",
"vue-excel-xlsx": "^1.2.2",
"vue-moment": "^4.1.0",
"vue-qrcode-component": "^2.1.1",
"vue-resource": "^1.5.3",
"vue-sessionstorage": "^1.0.0",
"vue-social-auth": "^1.4.9",
"vue-socket.io": "^3.0.10",
"vue2-storage": "^5.0.0",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
"vuex-map-fields": "^1.4.1",
"ziggy": "^2.4.0",
"ziggy-js": "^1.4.3"
}
when i call the url in webview using android studio. it says "[INFO:CONSOLE(2)] "Uncaught SyntaxError: Unexpected token ..."".
maybe the spread operator called by mistake. ?
here is my webpack.mix.js
mix
.webpackConfig({
resolve: {
alias: {
vue$: 'vue/dist/vue.runtime.esm.js',
'#': path.resolve('resources/js'),
ziggy: path.resolve('vendor/tightenco/ziggy/dist/vue')
}
},
plugins: [new VuetifyLoaderPlugin()],
})
.version()
.sourceMaps()
i still dont know how to fix this problem.

ReferenceError: describe is not defined WHEN run npm run dev

Any something wrong with my package.json? The test is green when I run npm run test. But when I run npm run dev, the test is also run. There is no command config I write that it should run test when I run npm run dev
here is my package.json
"name": "domundotech-cashier",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www",
"dev": "set DEBUG=domundotech-cashier:* & nodemon --exec & npm start",
"test": "node ./node_modules/mocha/bin/mocha \"*/*.spec.js\""
},
"dependencies": {
"acorn": "^8.1.0",
"body-parser": "^1.19.0",
"cookie-parser": "~1.4.4",
"cors": "^2.8.5",
"debug": "~2.6.9",
"dotenv": "^8.2.0",
"eslint-plugin-jest": "^24.3.3",
"express": "~4.16.1",
"express-useragent": "^1.0.15",
"http-errors": "~1.6.3",
"install": "^0.13.0",
"jade": "~1.11.0",
"moment-timezone": "^0.5.33",
"morgan": "~1.9.1",
"mysql2": "^2.2.5",
"node-device-detector": "^1.3.4",
"npm": "^7.8.0",
"request": "^2.88.2",
"sequelize": "^6.6.2",
"typescript": "^4.2.3"
},
"devDependencies": {
"sequelize-test-helpers": "^1.3.2",
"proxyquire": "^2.1.3",
"mocha": "^8.3.2",
"chai": "^4.3.4",
"sinon": "^10.0.0",
"sinon-chai": "^3.6.0",
"supertest": "^6.1.3",
"#typescript-eslint/eslint-plugin": "^4.20.0",
"#typescript-eslint/parser": "^4.20.0",
"eslint": "^7.23.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"sequelize-cli": "^6.2.0"
}
}
and this for the error logs
Describe is defined in my test file. For now, I found the solution that I should ignore (-i) test files when executing nodemon :)
"start": "node ./bin/www",
"dev": "set DEBUG=domundotech-cashier:* & nodemon -i ./test & npm start",
"test": "mocha \"./test/*/*.spec.js\""
},
And I refactor my project structure too

// #flow: Uncaught ReferenceError: number is not defined

I just copied an example from the official flow website:
// #flow
function doSomething<T>(param: T): T {
// ...
return param;
}
doSomething<number>(3);
And getting the error:
Uncaught ReferenceError: number is not defined
Though the following code works:
function abc(a: number) {
console.log(a);
}
What's wrong with the first snippet?
"flow-bin": "^0.92.1",
"flow-runtime": "^0.17.0",
"flow-typed": "^2.4.0"
I run app with
npm run dev
Here's a complete package.json
{
"name": "myapp",
"productName": "ElectronReact",
"version": "0.13.2",
"description": "Electron application boilerplate based on React, React Router, Webpack, React Hot Loader for rapid application development",
"scripts": {
"build": "concurrently \"npm run build-main\" \"npm run build-renderer\"",
"build-dll": "cross-env NODE_ENV=development node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.renderer.dev.dll.js --colors",
"build-main": "cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.main.prod.js --colors",
"build-renderer": "cross-env NODE_ENV=production node --trace-warnings -r babel-register ./node_modules/webpack/bin/webpack --config webpack.config.renderer.prod.js --colors",
"dev": "cross-env START_HOT=1 node -r babel-register ./internals/scripts/CheckPortInUse.js && cross-env START_HOT=1 npm run start-renderer-dev",
"electron-rebuild": "electron-rebuild --parallel --force --types prod,dev,optional --module-dir app",
"flow": "flow",
"flow-typed": "rimraf flow-typed/npm && flow-typed install --overwrite || true",
"lint": "cross-env NODE_ENV=development eslint --cache --format=node_modules/eslint-formatter-pretty .",
"lint-fix": "npm run lint -- --fix",
"lint-styles": "stylelint app/*.css app/components/*.css --syntax scss",
"lint-styles-fix": "stylefmt -r app/*.css app/components/*.css",
"package": "npm run build && build --publish never",
"package-all": "npm run build && build -mwl",
"package-linux": "npm run build && build --linux",
"package-win": "npm run build && build --win --x64",
"postinstall": "node -r babel-register internals/scripts/CheckNativeDep.js && npm run flow-typed && npm run build-dll && electron-builder install-app-deps && node node_modules/fbjs-scripts/node/check-dev-engines.js package.json",
"prestart": "npm run build",
"start": "cross-env NODE_ENV=production electron ./app/",
"start-main-dev": "cross-env HOT=1 NODE_ENV=development electron -r babel-register ./app/main.dev",
"start-renderer-dev": "cross-env NODE_ENV=development node --trace-warnings -r babel-register ./node_modules/webpack-dev-server/bin/webpack-dev-server --config webpack.config.renderer.dev.js",
"test": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 node --trace-warnings -r babel-register ./internals/scripts/RunTests.js",
"test-all": "npm run lint && npm run flow && npm run build && npm run test && npm run test-e2e",
"test-e2e": "cross-env NODE_ENV=test BABEL_DISABLE_CACHE=1 node --trace-warnings -r babel-register ./internals/scripts/RunTests.js e2e",
"test-watch": "npm test -- --watch"
},
"browserslist": "electron 1.6",
"build": {
"productName": "ElectronReact",
"appId": "org.develar.ElectronReact",
"files": [
"dist/",
"node_modules/",
"app.html",
"main.prod.js",
"main.prod.js.map",
"package.json"
],
"dmg": {
"contents": [
{
"x": 130,
"y": 220
},
{
"x": 410,
"y": 220,
"type": "link",
"path": "/Applications"
}
]
},
"win": {
"target": [
"nsis"
]
},
"linux": {
"target": [
"deb",
"AppImage"
],
"category": "Development"
},
"directories": {
"buildResources": "resources",
"output": "release"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/chentsulin/electron-react-boilerplate.git"
},
"author": {
"name": "C. T. Lin",
"email": "chentsulin#gmail.com",
"url": "https://github.com/chentsulin"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/chentsulin/electron-react-boilerplate/issues"
},
"keywords": [
"electron",
"boilerplate",
"react",
"redux",
"flow",
"sass",
"webpack",
"hot",
"reload"
],
"homepage": "https://github.com/chentsulin/electron-react-boilerplate#readme",
"jest": {
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/fileMock.js",
"\\.(css|less|sass|scss)$": "identity-obj-proxy"
},
"moduleFileExtensions": [
"js"
],
"moduleDirectories": [
"node_modules",
"app/node_modules"
],
"transform": {
"^.+\\.js$": "babel-jest"
},
"setupFiles": [
"./internals/scripts/CheckBuiltsExist.js"
]
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.1",
"babel-jest": "^22.1.0",
"babel-loader": "^7.1.2",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-dev-expression": "^0.2.1",
"babel-plugin-flow-runtime": "^0.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-es2015-classes": "^6.24.1",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"babel-preset-react-hmre": "^1.1.1",
"babel-preset-react-optimize": "^1.0.1",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.26.0",
"chalk": "^2.3.0",
"concurrently": "^3.5.1",
"cross-env": "^5.1.3",
"cross-spawn": "^6.0.4",
"css-loader": "^0.28.9",
"detect-port": "^1.2.2",
"electron": "^1.7.11",
"electron-builder": "^19.55.3",
"electron-devtools-installer": "^2.2.3",
"electron-rebuild": "^1.7.3",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "^3.3.1",
"eslint": "^4.16.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-formatter-pretty": "^1.3.0",
"eslint-import-resolver-webpack": "^0.8.4",
"eslint-plugin-compat": "^2.2.0",
"eslint-plugin-flowtype": "^3.2.1",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.7.0",
"eslint-plugin-jsx-a11y": "6.0.3",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-react": "^7.6.1",
"express": "^4.16.2",
"extract-text-webpack-plugin": "^3.0.2",
"fbjs-scripts": "^0.8.1",
"file-loader": "^1.1.6",
"flow-bin": "^0.92.1",
"flow-runtime": "^0.17.0",
"flow-typed": "^2.4.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^22.1.4",
"minimist": "^1.2.0",
"node-sass": "^4.7.2",
"npm-logical-tree": "^1.2.1",
"react-test-renderer": "^16.2.0",
"redux-logger": "^3.0.6",
"rimraf": "^2.6.2",
"sass-loader": "^6.0.6",
"sinon": "^4.2.2",
"spectron": "^3.8.0",
"style-loader": "^0.20.1",
"stylefmt": "^6.0.0",
"stylelint": "^8.4.0",
"stylelint-config-standard": "^18.0.0",
"uglifyjs-webpack-plugin": "1.1.8",
"url-loader": "^0.6.2",
"webpack": "^3.10.0",
"webpack-bundle-analyzer": "^2.9.2",
"webpack-dev-server": "^2.11.1",
"webpack-merge": "^4.1.1"
},
"dependencies": {
"axios": "^0.18.0",
"bootstrap": "^4.0.0",
"devtron": "^1.4.0",
"electron-debug": "^1.5.0",
"font-awesome": "^4.7.0",
"history": "^4.7.2",
"immutable": "^3.8.2",
"jquery": "^3.3.1",
"normalizr": "^3.2.4",
"popper.js": "^1.14.3",
"react": "^16.7.0",
"react-alert-template-basic": "^1.0.0",
"react-dom": "^16.7.0",
"react-hot-loader": "^4.0.0-beta.13",
"react-notification-system": "^0.2.17",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.6",
"react-tooltip": "^3.6.1",
"react-transition-group": "^2.3.1",
"reactstrap": "^7.1.0",
"redux": "^3.7.2",
"redux-form": "^7.3.0",
"redux-form-input-masks": "^1.1.4",
"redux-persist": "^5.10.0",
"redux-saga": "^0.16.2",
"source-map-support": "^0.5.3"
},
"devEngines": {
"node": ">=7.x",
"npm": ">=4.x",
"yarn": ">=0.21.3"
}
}
.flowconfig
[ignore]
<PROJECT_ROOT>/node_modules/*
<PROJECT_ROOT>/app/main.prod.js
<PROJECT_ROOT>/app/main.prod.js.map
<PROJECT_ROOT>/app/dist/.*
<PROJECT_ROOT>/resources/.*
<PROJECT_ROOT>/release/.*
<PROJECT_ROOT>/dll/.*
<PROJECT_ROOT>/release/.*
<PROJECT_ROOT>/git/.*
[include]
[libs]
[options]
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
esproposal.export_star_as=enable
module.name_mapper.extension='css' -> '<PROJECT_ROOT>/internals/flow/CSSModule.js.flow'
module.name_mapper.extension='styl' -> '<PROJECT_ROOT>/internals/flow/CSSModule.js.flow'
module.name_mapper.extension='scss' -> '<PROJECT_ROOT>/internals/flow/CSSModule.js.flow'
module.name_mapper.extension='png' -> '<PROJECT_ROOT>/internals/flow/WebpackAsset.js.flow'
module.name_mapper.extension='jpg' -> '<PROJECT_ROOT>/internals/flow/WebpackAsset.js.flow'
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue
Explicit type parameters (like <number>) are only available in Babel 7. Your code is being executed as doSomething < number

Non deterministic behavior on dependencies - nodejs

I would solve a warning: when I run yarn install all dependencies are installed but I receive this warning:
warning Pattern ["esprima-fb#~3001.0001.0000-dev-harmony-fb"] is
trying to unpack in the same destination
"/Users/Me/Library/Caches/Yarn/v1/npm-esprima-fb-3001.1.0-dev-harmony-fb-b77d37abcd38ea0b77426bb8bc2922ce6b426411"
as pattern ["esprima-fb#~3001.1.0-dev-harmony-fb"]. This could result
in a non deterministic behavior, skipping.
If I delete node_modules folder and I run yarn install I don't receive the warning, when I re-execute yarn install I receive it again.
I suppose the problem is in yarn-lock file.
package.json
{
"name": "n1",
"version": "1.0.0",
"description": "none ",
"author": "none",
"main": "src/index.js",
"private": false,
"engines": {
"node": ">=7.6",
"yarn": "*"
},
"scripts": {
"precommit": "yarn lint",
"prestart": "yarn docs",
"start": "cross-env NODE_ENV=production pm2 start ./src/index.js",
"dev": "nodemon ./src/index.js",
"lint": "eslint **/*.js --ignore-path .gitignore --ignore-pattern internals/scripts",
"lint:fix": "yarn lint -- --fix",
"lint:watch": "yarn lint -- --watch",
"test": "cross-env NODE_ENV=test nyc --reporter=html --reporter=text mocha --timeout 20000 --recursive src/api/tests",
"test:unit": "cross-env NODE_ENV=test mocha src/api/tests/unit",
"test:integration": "cross-env NODE_ENV=test mocha --timeout 20000 src/api/tests/integration",
"test:watch": "cross-env NODE_ENV=test mocha --watch src/api/tests/unit",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"postcoverage": "opn coverage/lcov-report/index.html",
"validate": "yarn lint && yarn test",
"postpublish": "git push --tags",
"docs": "apidoc -i src -o docs",
"postdocs": "opn docs/index.html"
},
"dependencies": {
"bcryptjs": "^2.4.3",
"blubird": "^0.0.1-security",
"bluebird": "^3.5.1",
"body-parser": "^1.18.2",
"chalk": "^2.3.0",
"color": "^2.0.1",
"compression": "^1.7.1",
"cookie-parser": "^1.4.3",
"cors": "^2.8.4",
"cross-env": "^5.1.3",
"dotenv-safe": "^4.0.4",
"espree": "^3.5.2",
"esprima": "^4.0.0",
"express": "^4.16.2",
"express-validation": "^1.0.2",
"express-winston": "^2.4.0",
"helmet": "^3.9.0",
"http-status": "^1.0.1",
"joi": "^10.6.0",
"jwt-simple": "^0.5.1",
"lodash": "^4.17.4",
"method-override": "^2.3.10",
"moment": "^2.20.1",
"moment-timezone": "^0.5.14",
"mongoose": "^4.13.7",
"morgan": "^1.9.0",
"morgan-body": "^2.0.2",
"mysql": "^2.15.0",
"mysql2": "^1.5.1",
"nedb": "^1.8.0",
"node-geocoder": "^3.21.1",
"only": "0.0.2",
"passport": "^0.4.0",
"passport-jwt": "^3.0.1",
"pm2": "^2.9.1",
"readline-sync": "^1.4.7",
"request-promise": "^4.2.2",
"sequelize": "^4.28.6",
"serve-favicon": "^2.4.5",
"winston": "^2.4.0",
"yarn": "^1.3.2"
},
"devDependencies": {
"apidoc": "^0.17.5",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
"coveralls": "^2.13.1",
"eslint": "^4.13.1",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.8.0",
"husky": "^0.14.3",
"mocha": "^3.5.3",
"nodemon": "^1.14.1",
"nyc": "^11.4.1",
"opn-cli": "^3.1.0",
"sinon": "^3.3.0",
"sinon-chai": "^2.14.0",
"supertest": "^3.0.0"
},
"license": "MIT"
}
yarn-lock
https://pastebin.com/vTrLHWff
Try removing both node_modules and yarn.lock:
rm -rf node_modules and rm yarn.lock
And then try running:
npm run rebuild which seem to help to resolve the issue.

Categories