I am having an issue with adding laravel-elixir to my package.json file in order to run gulp. When I run the command $ gulp i receive an error stating that laravel-elixir module cannot be found. So, adding the module to my package.json file then running npm install causes an error. (npm install works fine without the laravel-elixir module in package.json)
I have read through all the documentation and have ensured everything is installed. This seems to be a bit of an issue from what i have researched (sorry in advanced if this might be a dublicate). I just cannot seem to find the fix here. Please comment and let me know if you need to see the errors or anything.
package.json
{
"private": true,
"devDependencies": {
"gulp": "^3.9.1",
"gulp-bower": "0.0.13",
"run-sequence": "^1.2.2",
"babel-cli": "^6.7.7",
"babel-preset-es2015": "^6.9.0",
"chai": "^3.5.0",
"laravel-elixir-browserify-official": "^0.1.3",
"laravel-elixir-coffeescript": "^1.0.2",
"laravel-elixir-rollup-official": "^1.0.4",
"laravel-elixir-stylus": "^2.0.2",
"laravel-elixir-vue": "^0.1.4",
"laravel-elixir-webpack-official": "^1.0.1",
"mocha": "^2.4.5",
"rimraf": "^2.5.2",
"laravel-elixir": "^4.0.0"
},
"dependencies": {
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"es2015": "0.0.0",
"gulp-install": "^1.1.0",
"react": "^0.14.6",
"vue": "^1.0.28",
"vue-resource": "^0.5.1",
"vue-router": "^0.7.13",
"vue-validator": "^2.1.7",
"gulp-coffee": "^2.3.1",
"clean-css": "^3.4.12",
"cli-table": "^0.3.1",
"del": "^2.2.0",
"glob": "^7.0.3",
"gulp-autoprefixer": "^3.1.0",
"gulp-batch": "^1.0.5",
"gulp-concat": "^2.6.0",
"gulp-if": "^2.0.0",
"gulp-less": "^3.0.5",
"gulp-load-plugins": "^1.2.2",
"gulp-notify": "^2.2.0",
"gulp-rename": "^1.2.2",
"gulp-rev": "^7.0.0",
"gulp-rev-replace": "^0.4.3",
"gulp-sass": "^3.1.0",
"gulp-shell": "^0.5.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"parse-filepath": "^1.0.1",
"path": "^0.12.7",
"q": "^1.4.1",
"require-dir": "^0.3.2",
"run-sequence": "^1.1.5",
"underscore": "^1.8.3",
"vinyl-map2": "^1.2.1"
}
}
Gulp File
var gulp = require("gulp");
var bower = require("gulp-bower");
var elixir = require("laravel-elixir");
gulp.task('bower', function () {
return bower();
});
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
*/
var vendors = '../../../bower_components/';
var paths = {
'jquery': vendors + 'jquery/dist',
'jqueryUi': vendors + 'jquery-ui',
'moment': vendors + 'moment',
'bootstrap': vendors + 'bootstrap/dist',
'dataTables': vendors + 'datatables/media',
'jquerycookie': vendors + 'jquery.cookie',
'fontawesome': vendors + 'font-awesome',
'animate': vendors + 'animate.css',
'underscore': vendors + 'underscore',
'tether': vendors + 'tether/dist',
'jQueryStorageAPI': vendors + 'jQuery-Storage-API',
'pace': vendors + 'PACE',
'lazyload': vendors + 'lazyload',
'screenfull': vendors + 'screenfull/dist',
'select2': vendors + 'select2/dist',
'select2TabFix': vendors + 'select2-tab-fix',
'eonasdanBootstrapDatetimepicker': vendors + 'eonasdan-bootstrap-datetimepicker/build',
'fullcalendar': vendors + 'fullcalendar/dist',
'summernote': vendors + 'summernote/dist',
'morris': vendors + 'morris.js',
'raphael': vendors + 'raphael',
'algoliasearch': vendors + 'algoliasearch/dist/',
'algoliaAutocomplete': vendors + 'algolia-autocomplete.js/dist/',
'typeahead': vendors + 'typeahead.js/dist/',
'pusher': vendors + 'pusher/dist/',
'icheck': vendors + 'iCheck',
'jasnyBootstrap': vendors + 'jasny-bootstrap/dist',
'toastr': vendors + 'toastr/',
'dropzone': vendors + 'dropzone/dist',
'select2BootstrapTheme': vendors + 'select2-bootstrap-theme/dist',
'c3': vendors + '/c3/'
};
elixir.config.sourcemaps = false;
elixir(function (mix) {
// Run bower install
mix.task('bower');
//Custom Styles
mix.styles(
[
'lcrm_bootstrap.css', 'metisMenu.min.css', 'lcrm.css', 'mail.css'
], 'public/css/secure.css');
//Custom Javascript
mix.browserify(['app.js'], 'public/js/secure.js');
/**
* Vendor files
* run "gulp --production"
*/
if (elixir.config.production) {
// Copy js straight to public
mix.copy('resources/assets/js/metisMenu.min.js', 'public/js');
mix.copy('resources/assets/js/datetime-moment.js', 'public/js');
mix.copy('resources/assets/js/lcrm_app.js', 'public/js');
mix.copy('resources/assets/js/todolist.js', 'public/js');
// Copy fonts straight to public
mix.copy('bower_components/bootstrap/fonts', 'public/fonts/bootstrap');
mix.copy('bower_components/font-awesome/fonts', 'public/fonts');
mix.copy('resources/assets/css/material-design-icons/iconfont', 'public/fonts');
// Copy images straight to public
mix.copy('bower_components/bootstrap-fileinput/img', 'public/img');
mix.copy('bower_components/jquery-ui/themes/base/images', 'public/img');
mix.copy('bower_components/datatables/media/images', 'public/img');
mix.copy('resources/assets/img', 'public/img');
mix.copy('resources/assets/images', 'public/images');
mix.copy('resources/assets/img/logo.png', 'public/uploads/site');
mix.copy('resources/assets/img/fav.ico', 'public/uploads/site');
mix.copy('resources/assets/img/user.png', 'public/uploads/avatar');
// copy js files ( we don't need to combine all files into single js)
mix.copy('bower_components/screenfull/dist/screenfull.min.js', 'public/js');
//c3&d3 chart css and js files
mix.copy('bower_components/c3/c3.min.css', 'public/css');
mix.copy('bower_components/c3/c3.min.js', 'public/js');
mix.copy('bower_components/d3/d3.min.js', 'public/js');
mix.copy('resources/assets/js/d3.v3.min.js', 'public/js');
//jvector map files
mix.copy('bower_components/bower-jvectormap/jquery-jvectormap-1.2.2.min.js', 'public/js');
mix.copy('resources/assets/css/jquery-jvectormap.css', 'public/css');
mix.copy('resources/assets/js/jquery-jvectormap-us-aea-en.js', 'public/js');
//icheck
mix.copy('resources/assets/css/icheck.css','public/css');
mix.copy('bower_components/iCheck/icheck.min.js','public/js');
//countUp
mix.copy('bower_components/countUp.js/dist/countUp.min.js', 'public/js');
//jQuery Sortable
mix.copy('resources/assets/js/jquery-sortable.js', 'public/js');
//CSS Libraries
mix.styles([paths.fontawesome + "/css/font-awesome.min.css",
paths.animate + "/animate.min.css",
"resources/assets/css/material-design-icons/material-design-icons.css",
paths.select2 + "/css/select2.min.css",
paths.eonasdanBootstrapDatetimepicker + '/css/bootstrap-datetimepicker.css',
'dataTables.bootstrap.css',
paths.fullcalendar + '/fullcalendar.css',
paths.summernote + '/summernote.css',
paths.summernote + '/summernote-bs3.css',
paths.morris + '/morris.css',
paths.dropzone + '/dropzone.css',
paths.jasnyBootstrap + "/css/jasny-bootstrap.min.css",
paths.toastr + '/toastr.css',
paths.select2BootstrapTheme + "/select2-bootstrap.min.css"
], 'public/css/libs.css');
//JS Libraries
mix.scripts([paths.jquery + "/jquery.js",
paths.jqueryUi + "/jquery-ui.min.js",
paths.tether + "/js/tether.min.js",
paths.bootstrap + "/js/bootstrap.min.js",
paths.dataTables + "/js/jquery.dataTables.min.js",
paths.dataTables + "/js/dataTables.bootstrap.js",
paths.jquerycookie + "/jquery.cookie.js",
paths.pace + '/pace.min.js',
paths.underscore + "/underscore-min.js",
paths.select2 + "/js/select2.min.js",
paths.select2TabFix + "/src/select2-tab-fix.min.js",
paths.moment + '/moment.js',
paths.eonasdanBootstrapDatetimepicker + '/js/bootstrap-datetimepicker.min.js',
paths.fullcalendar + '/fullcalendar.js',
paths.summernote + '/summernote.js',
paths.morris + '/morris.js',
paths.raphael + '/raphael.js',
paths.algoliasearch + '/algoliasearch.min.js',
paths.algoliaAutocomplete + '/autocomplete.min.js',
paths.typeahead + '/typeahead.jquery.min.js',
paths.pusher + '/pusher.js',
paths.toastr + 'toastr.min.js',
paths.jasnyBootstrap + "/js/jasny-bootstrap.min.js",
"palette.js"
], 'public/js/libs.js');
}
});
Error
npm install
npm WARN deprecated minimatch#1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
> node-sass#3.13.1 install C:\xampp\htdocs\trinet\node_modules\laravel-elixir\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/win32-x64-57_binding.node":
HTTP error 404 Not Found
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
> uws#9.14.0 install C:\xampp\htdocs\trinet\node_modules\uws
> node-gyp rebuild > build_log.txt 2>&1 || exit 0
> node-sass#3.13.1 postinstall C:\xampp\htdocs\trinet\node_modules\laravel-elixir\node_modules\node-sass
> node scripts/build.js
Building: C:\Program Files\nodejs\node.exe
C:\xampp\htdocs\trinet\node_modules\node-gyp\bin\node-gyp.js rebuild --
verbose --libsass_ext= --libsass_cflags= --lib
sass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'C:\\xampp\\htdocs\\trinet\\node_modules\\node-
gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp#3.6.2
gyp info using node#8.11.1 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable
"C:/Users/user/AppData/Local/Programs/Python/Python37/python.exe" in the PATH
gyp verb `which` succeeded
C:/Users/user/AppData/Local/Programs/Python/Python37/python.exe
C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe
gyp verb check python version
`C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe -c "import platform; print(platform.python_version());"` retur ned: "3.7.0b3\r\n"
gyp verb could not find "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe". checking python launcher
gyp verb could not find "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\user\AppData\Local\Programs\Python\Python37\python.exe", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\xampp\htdocs\trinet\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\xampp\htdocs\trinet\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at C:\xampp\htdocs\trinet\node_modules\node-gyp\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\xampp\\htdocs\\trinet\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ex t=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\xampp\htdocs\trinet\node_modules\laravel-elixir\node_modules\node-sass
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN buble-loader#0.2.2 requires a peer of buble#^0.12.0 but none is installed. You must install peer dependencies yourself.
npm WARN vue-template-validator#1.1.5 requires a peer of parse5#^2.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package run-sequence is included as both a dev and production dependency.
npm WARN The package babel-preset-es2015 is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} )
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Try installing python first , since it is searching for the executable and unable to find it
Related
if someone can assist to figure out the error after tried to updated to Node v 18.14.0 and npm v. 9.3.1.
Also I have updated some packages versions such us eslint to required one, react-scripts to the latest one, babel/core and babel loader.
Below is package.json
"dependencies": {
"#azure/communication-calling": "1.9.1-beta.1",
"#azure/communication-common": "1.0.0",
"#azure/logger": "^1.0.2",
"#date-io/moment": "^1.3.13",
"#material-ui/core": "4.12.1",
"#material-ui/icons": "^4.11.2",
"#material-ui/lab": "^4.0.0-alpha.56",
"#material-ui/pickers": "^3.2.10",
"#microsoft/signalr": "6.0.10",
"#microsoft/teams-js": "1.9.0",
"#ungap/global-this": "^0.4.0",
"axios": "1.3.1",
"botframework-webchat": "4.9.1",
"chart.js": "^3.7.0",
"chartjs-plugin-datalabels": "^2.1.0",
"classnames": "2.2.6",
"core-js": "^3.6.5",
"dompurify": "^2.2.7",
"easy-peasy": "3.3.0",
"eslint": "^8.33.0",
"formik": "2.1.4",
"html2canvas": "^1.4.1",
"husky": "4.2.5",
"i18next": "^19.6.2",
"i18next-browser-languagedetector": "^5.0.0",
"i18next-http-backend": "^1.0.21",
"inputmask": "5.0.5",
"insert-text-at-cursor": "0.3.0",
"lint-staged": "10.1.7",
"lodash": "^4.17.21",
"lottie-react-web": "2.1.4",
"moment": "^2.26.0",
"nanoid": "^3.1.23",
"prettier": "2.0.5",
"query-string": "6.12.1",
"react": "16.13.1",
"react-app-polyfill": "^1.0.6",
"react-audio-player": "^0.17.0",
"react-calendar": "3.3.1",
"react-chartjs-2": "^4.0.1",
"react-datepicker": "^4.9.0",
"react-device-detect": "^1.15.0",
"react-dom": "16.13.1",
"react-i18next": "^11.7.3",
"react-idle-timer": "4.5.2",
"react-image-crop": "^10.0.1",
"react-images-upload": "1.2.8",
"react-payment-inputs": "1.1.7",
"react-phone-number-input": "3.1.17",
"react-pose": "4.0.10",
"react-router-dom": "5.1.2",
"react-scripts": "5.0.1",
"react-select": "^5.5.9",
"react-swipeable": "^5.5.1",
"react-table": "^7.7.0",
"react-waypoint": "9.0.2",
"shortid": "2.2.15",
"source-map-explorer": "2.4.2",
"split-string": "6.1.0",
"styled-components": "5.1.0",
"url-parse": "1.4.7",
"use-debounce": "^7.0.0",
"use-react-router": "1.0.7",
"yup": "0.28.4"
},
"scripts": {
"start": "react-scripts --max_old_space_size=16384 start",
"build": "react-scripts --max_old_space_size=16384 build",
"test": "react-scripts test",
"pretty:all": "npx prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
"analyze": "source-map-explorer 'build/static/js/*.js'",
"tunnel": "~/ngrok http 3000 --hostname andor-chad.ngrok.io",
"storybook": "start-storybook -p 9009 -s public",
"build-storybook": "build-storybook -s public",
"tw": "npx tailwindcss build ./src/tailwind-source.css -o ./src/tailwind.css"
},
"eslintConfig": {
"extends": "react-app"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [
"prettier --write",
"git add"
]
},
"browserslist": [
">0.2%",
"not dead",
"not op_mini all"
],
"devDependencies": {
"#babel/core": "7.20.12",
"#storybook/addon-actions": "5.3.18",
"#storybook/addon-knobs": "5.3.18",
"#storybook/addon-links": "5.3.18",
"#storybook/addons": "5.3.18",
"#storybook/preset-create-react-app": "3.1.2",
"#storybook/react": "6.5.16",
"babel-loader": "9.1.2",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "4.2.1",
"npm-run-all": "4.1.5",
"tailwindcss": "1.9.0",
"tailwindcss-theming": "2.4.3"
}
}
Below is the error log after npm i. I think, it is a conflict with webpack version and babel/core.
npm ERR! code 1
npm ERR! path C:\Users\OleksandrDashevskyi\WebstormProjects\AndorHealth.ThinkAndor.ClientUiReact\node_modules\markdown-it-attrs-es5
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c npx -p webpack-cli#3.3.11 -p webpack#4.43.0 webpack-cli --config webpack-lib.config.js
npm ERR! C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\webpack-cli\bin\cli.js:93
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module 'ret'
npm ERR! Require stack:
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\safe-regex\index.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\to-regex\index.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\braces\index.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\micromatch\index.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\findup-sync\index.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\webpack-cli\bin\utils\convert-argv.js
npm ERR! - C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\webpack-cli\bin\cli.js
npm ERR! at Module._resolveFilename (node:internal/modules/cjs/loader:1047:15)
npm ERR! at Module._load (node:internal/modules/cjs/loader:893:27)
npm ERR! at Module.require (node:internal/modules/cjs/loader:1113:19)
npm ERR! at require (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
npm ERR! at Object.<anonymous> (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\safe-regex\index.js:1:75)
npm ERR! at Module._compile (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:1089:32)
npm ERR! at Module._load (node:internal/modules/cjs/loader:930:12)
npm ERR! at Module.require (node:internal/modules/cjs/loader:1113:19)
npm ERR! at require (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
npm ERR! at Object.<anonymous> (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\to-regex\index.js:3:12)
npm ERR! at Module._compile (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:1089:32)
npm ERR! at Module._load (node:internal/modules/cjs/loader:930:12)
npm ERR! at Module.require (node:internal/modules/cjs/loader:1113:19)
npm ERR! at require (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
npm ERR! at Object.<anonymous> (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\braces\index.js:7:15)
npm ERR! at Module._compile (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:1089:32)
npm ERR! at Module._load (node:internal/modules/cjs/loader:930:12)
npm ERR! at Module.require (node:internal/modules/cjs/loader:1113:19)
npm ERR! at require (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
npm ERR! at Object.<anonymous> (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\micromatch\index.js:8:14)
npm ERR! at Module._compile (C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_npx\4ac7b0a62e2227a1\node_modules\v8-compile-cache\v8-compile-cache.js:192:30)
npm ERR! at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:1089:32)
npm ERR! at Module._load (node:internal/modules/cjs/loader:930:12) {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: [
npm ERR! 'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\safe-regex\\index.js',
npm ERR! 'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\to-regex\\index.js',
npm ERR! 'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\braces\\index.js',
npm ERR! 'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\micromatch\\index.js',
npm ERR! 'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\findup-sync\\index.js',
npm ERR! 'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js',
npm ERR! 'C:\\Users\\OleksandrDashevskyi\\AppData\\Local\\npm-cache\\_npx\\4ac7b0a62e2227a1\\node_modules\\webpack-cli\\bin\\cli.js'
npm ERR! ]
npm ERR! }
npm ERR!
npm ERR! Node.js v18.14.0
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\OleksandrDashevskyi\AppData\Local\npm-cache\_logs\2023-02-03T20_06_06_443Z-debug-0.log
Process finished with exit code 1
I'm getting the below error when I do npm install in my project
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-scripts#4.0.1
npm ERR! Found: typescript#4.1.3
npm ERR! node_modules/typescript
npm ERR! dev typescript#"^4.1.3" from the root project
npm ERR! peer typescript#">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" from tsutils#3.21.0
npm ERR! node_modules/tsutils
npm ERR! tsutils#"^3.21.0" from #typescript-eslint/eslint-plugin#4.28.3
npm ERR! node_modules/#typescript-eslint/eslint-plugin
npm ERR! peer #typescript-eslint/eslint-plugin#"^4.0.0" from eslint-config-react-app#6.0.0
npm ERR! node_modules/eslint-config-react-app
npm ERR! eslint-config-react-app#"^6.0.0" from react-scripts#4.0.1
npm ERR! node_modules/react-scripts
npm ERR! 2 more (eslint-plugin-jest, react-scripts)
npm ERR! tsutils#"^3.21.0" from #typescript-eslint/typescript-estree#4.28.3
npm ERR! node_modules/#typescript-eslint/typescript-estree
npm ERR! #typescript-eslint/typescript-estree#"4.28.3" from #typescript-eslint/experimental-utils#4.28.3
npm ERR! node_modules/#typescript-eslint/experimental-utils
npm ERR! #typescript-eslint/experimental-utils#"4.28.3" from #typescript-eslint/eslint-plugin#4.28.3
npm ERR! node_modules/#typescript-eslint/eslint-plugin
npm ERR! 1 more (eslint-plugin-jest)
npm ERR! 1 more (#typescript-eslint/parser)
npm ERR! 1 more (#typescript-eslint/typescript-estree)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript#"^3.2.1" from react-scripts#4.0.1
npm ERR! node_modules/react-scripts
npm ERR! dev react-scripts#"^4.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: typescript#3.9.10
npm ERR! node_modules/typescript
npm ERR! peerOptional typescript#"^3.2.1" from react-scripts#4.0.1
npm ERR! node_modules/react-scripts
npm ERR! dev react-scripts#"^4.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
This is my package.json
{
"name": "node_modules",
"version": "1.0.7",
"private": true,
"license": "ISC",
"dependencies": {
"#microsoft/applicationinsights-react-js": "^2.3.1",
"#microsoft/applicationinsights-web": "^2.3.1",
"#progress/kendo-common": "^0.2.1",
"#progress/kendo-data-query": "^1.5.4",
"#progress/kendo-drawing": "^1.9.3",
"#progress/kendo-file-saver": "^1.1.0",
"#progress/kendo-react-charts": "^3.18.0",
"#progress/kendo-react-common": "^3.18.0",
"#progress/kendo-react-inputs": "^3.18.0",
"#progress/kendo-react-intl": "^3.18.0",
"#progress/kendo-react-layout": "^3.18.0",
"#progress/kendo-react-popup": "^3.18.0",
"#progress/kendo-theme-default": "^4.32.0",
"#progress/kendo-theme-material": "^3.28.0",
"#telerik/kendo-intl": "^2.3.0",
"async": "^2.6.4",
"azure-maps-control": "^2.0.31",
"ejs": "^3.1.7",
"hammerjs": "^2.0.8",
"jquery": "^3.5.1",
"kendo-ui-react": "^0.14.2",
"minimist": "^1.2.6",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"typescript-collections": "^1.3.3",
"web-vitals": "^0.2.4",
"y18n": "^5.0.5"
},
"devDependencies": {
"#fortawesome/fontawesome-free": "^5.15.2",
"#testing-library/jest-dom": "^5.11.9",
"#testing-library/react": "^11.2.3",
"#testing-library/user-event": "^12.6.2",
"#types/history": "^4.7.8",
"#types/jest": "^26.0.20",
"#types/jquery": "^3.5.5",
"#types/node": "^12.19.15",
"#types/react": "^16.9.0",
"#types/react-dom": "^16.9.0",
"react-scripts": "^4.0.1",
"typescript": "^4.1.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
I don't understand how to fix this issue.
Try doing npm install --legacy-peer-deps
I am running npm install for below package.json project file:
{
"name": "tradesync",
"version": "1.0.0",
"description": "",
"main": "consumer.js",
"dependencies": {
"async": "^2.6.1",
"avsc": "^5.1.1",
"cron": "^1.3.0",
"deepstream.io-client-js": "^2.3.0",
"firebase-admin": "^5.5.1",
"got": "^8.3.1",
"kafka-avro": "^0.8.0",
"mysql": "^2.15.0",
"node-avro-io": "^1.0.1",
"node-cron": "^1.2.1",
"node-rdkafka": "^2.2.2",
"orderbook-engine": "^1.1.2",
"requestretry": "^1.12.2",
"schema-registry": "^1.17.0",
"slack-node": "^0.1.8",
"socket.io-client": "^2.0.4",
"tedious": "^2.1.5",
"tedious-connection-pool": "^1.0.5",
"underscore": "^1.8.3",
"winston": "^2.4.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"ordermatcher",
"mywallet"
],
"author": "",
"license": "ISC",
"bugs": {
"url": ""
},
"homepage": ""
}
It's breaking and showing error logs at v8 functions, here is the partial snapshot of error logs
/home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/v8.h:3914:44: note: candidate expects 1 argument, 2 provided
../src/Int64.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Int64::Sub(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/Int64.cc:361:53: error: no matching function for call to ‘v8::Function::NewInstance(int, v8::Local<v8::Value> [2])’
Local<Object> instance = cons->NewInstance(2, argv);
^
In file included from /home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/node.h:63:0,
from ../src/Int64.cc:5:
/home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/v8.h:3911:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>, int, v8::Local<v8::Value>*) const
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
^
/home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/v8.h:3911:44: note: candidate expects 3 arguments, 2 provided
/home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/v8.h:3914:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
^
/home/local/mywallet/suresh.prajapati/.node-gyp/10.6.0/include/node/v8.h:3914:44: note: candidate expects 1 argument, 2 provided
Int64.target.mk:102: recipe for target 'Release/obj.target/Int64/src/Int64.o' failed
make: *** [Release/obj.target/Int64/src/Int64.o] Error 1
make: Leaving directory '/home/local/mywallet/suresh.prajapati/projects/tradesync/node_modules/int64-native/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.13.0-45-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build"
gyp ERR! cwd /home/local/mywallet/suresh.prajapati/projects/tradesync/node_modules/int64-native
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! int64-native#0.4.0 install: `node-gyp configure && node-gyp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the int64-native#0.4.0 install script.
Here is sys version info
node - v10.6.0
npm - 6.1.0
Python - 2.7.12
Searched on the internet but none of them actually helped. Ready to try out anything which can solve above build fail problem.
Tons of thanks in advance.
This can be a Node issue. Try to install latest LTS version https://nodejs.org/en/download/ .
Should fix it.
I've defined my npm dependency in the package.json file:
{
"name": "phash-hamming",
"version": "0.0.1",
"dependencies": {
"phash-image": "3.5.0"
}
}
In my index.js the first line causes an error:
var phash = require('phash-image');
The Error:
Build failed: exit status 1
phash-image#3.5.0 install /workspace/node_modules/phash-image
node-gyp rebuild
/bin/sh: 1: pkg-config: not found gyp: Call to 'pkg-config
--libs-only-L --libs-only-other pHash' returned exit status 127 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure
error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR!
stack at ChildProcess.onCpExit
(/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at
ChildProcess.emit (events.js:191:7) gyp ERR! stack at
Process.ChildProcess._handle.onexit (internal/child_process.js:219:12)
gyp ERR! System Linux 4.4.0-116-generic gyp ERR! command
"/nodejs/bin/node"
"/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
"rebuild" gyp ERR! cwd /workspace/node_modules/phash-image gyp ERR!
node -v v6.11.5 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok
https://github.com/mgmtio/phash-image
Read the Installation section.
phash-image depends on CImg, pHash, ImageMagicK.
Do you have install one of above?
The following worked for me:
1.Load the phash-image library from inside the function you are calling.
2.Use the package.json from the phash-image repo.
Your index.js:
exports.helloWorld = (req, res) => {
var phash = require('phash-image');
};
Your package.json:
{
"name": "phash-image",
"version": "3.5.0",
"description": "phash for images",
"repository": "mgmtio/phash-image",
"devDependencies": {
"bluebird": "^3.1.5",
"hamming-distance": "^1.0.0",
"istanbul": "^0.4.2",
"mocha": "^3.0.0",
"node-gyp": "^3.3.0"
},
"script": {
"preinstall": "node-gyp configure build",
"preuninstall": "rm -rf build/*"
},
"scripts": {
"build": "node-gyp configure build",
"test": "npm run build && mocha",
"test-cov": "npm run build && istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
"test-travis": "npm run build && istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
},
"keywords": [
"pHash",
"phash",
"libpHash",
"native",
"binding",
"addon"
],
"author": "Aaron Marasco <agm257#mail.missouri.edu>",
"contributors": [
"Aaron Marasco <agm257#mail.missouri.edu>",
"Taeho Kim <xissysnd#gmail.com>",
"Jeremy Dowell <jeremy#codevinsky.com>",
"Rod Vagg <r#va.gg> (https://github.com/rvagg)",
"Jonathan Ong <me#jongleberry.com> (https://github.com/jonathanong)"
],
"dependencies": {
"any-promise": "^1.1.0",
"nan": "^2.0.5"
},
"license": "MIT"
}
I am trying to compile files with webpack and npm for my reactJS applciation.
When I run npm start, it all goes well.
When I run npm run deploy or npm run build it does not work under a windows environment. It does work under a linux environment.
Does someone have an idea why ?
My files :
package.json
{
"license": "UNLICENSED",
"private": true,
"version": "1.0.0",
"webPath": "web/",
"nodePath": "node_modules/",
"devDependencies": {
"autoprefixer": "^6.3.1",
"exports-loader": "^0.6.2",
"grunt": "^0.4.5",
"grunt-autoprefixer": "^3.0.3",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-cssmin": "^0.14.0",
"grunt-contrib-less": "^1.1.0",
"grunt-contrib-uglify": "^0.11.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-css-url-rewrite": "^0.3.5",
"grunt-cssjoin": "^0.3.0",
"grunt-postcss": "^0.7.1",
"imports-loader": "^0.6.5",
"matchdep": "^1.0.0",
"redux-devtools": "^3.0.2",
"redux-devtools-dock-monitor": "^1.0.1",
"redux-devtools-log-monitor": "^1.0.4",
"webpack-shell-plugin": "^0.4.2"
},
"repository": {
"type": "git",
"url": ""
},
"dependencies": {
"babel-core": "^6.4.0",
"babel-loader": "^6.2.1",
"babel-plugin-transform-runtime": "^6.4.3",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"babel-runtime": "^6.3.19",
"grunt-postcss": "^0.7.1",
"history": "^1.17.0",
"i18next": "^2.5.1",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.11.1",
"radium": "^0.16.2",
"rc-switch": "^1.4.2",
"react": "^0.14.6",
"react-dom": "^0.14.6",
"react-hot-loader": "^1.3.0",
"react-redux": "^4.1.2",
"react-router": "^1.0.3",
"react-router-redux": "^3.0.0",
"redux": "^3.1.6",
"redux-thunk": "^2.1.0",
"selfupdate": "^1.1.0",
"webpack": "^1.12.11",
"webpack-dev-server": "^1.14.1",
"whatwg-fetch": "^0.11.0"
},
"scripts": {
"start": "node webpack.dev-server.js",
"build": "webpack",
"deploy": "NODE_ENV=production webpack -p --config webpack.production.config.js"
}
}
webpack.config.js
var path = require('path');
var webpack = require('webpack');
var node_modules_dir = path.join(__dirname, 'node_modules');
var devFlagPlugin = new webpack.DefinePlugin({
__DEV__: JSON.stringify(JSON.parse(process.env.DEBUG || 'false'))
});
console.log(__dirname);
var config = {
entry: [
'babel-polyfill',
'webpack-dev-server/client?http://127.0.0.1:3000',
'webpack/hot/only-dev-server',
'./app/Resources/react/app.js'
],
output: {
path: path.join(__dirname, 'web/js'),
filename: 'bundle.js',
publicPath: 'http://127.0.0.1:3000/static/'
},
debug: true,
devtool: 'eval',
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
devFlagPlugin
],
module: {
loaders: [
{
loaders: ["react-hot","babel-loader?plugins=transform-runtime&presets[]=es2015&presets[]=stage-0&presets[]=react"],
test: /\.js$/,
include: path.join(__dirname, 'app/Resources/react')
}
]
}
};
module.exports = config;
/*
new webpack.ProvidePlugin({
'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
})
*/
webpack.dev-server.js
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
historyApiFallback: true,
quiet: false,
noInfo: false,
contentBase: "./assets"
}).listen(3000, 'localhost', function (err, result) {
if (err) {
console.log(err);
}
console.log('Listening at localhost:3000');
});
webpack.production.config.js
var path = require('path');
var node_modules_dir = path.resolve(__dirname, 'node_modules');
var config = {
entry: [
'babel-polyfill',
'./app/Resources/react/app.js'
],
debug: false,
output: {
path: path.join(__dirname, 'web/js'),
filename: 'bundle.js'
},
module: {
loaders: [
{
loaders: ["babel-loader?plugins=transform-runtime&presets[]=es2015&presets[]=stage-0&presets[]=react"],
test: /\.js$/,
include: path.join(__dirname, 'app/Resources/react')
}
]
},
plugins: []
};
module.exports = config;
I get the following error with npm run build
Microsoft Windows [Version 10.0.10586] (c) 2015 Microsoft Corporation.
All rights reserved.
D:\Divers\Programmation\Web\foodmeup.dev>npm run build
FoodMeUp#1.0.0 build D:\Divers\Programmation\Web\foodmeup.dev
webpack
D:\Divers\Programmation\Web\foodmeup.dev Hash: 9cb8c898ada89430aa7c
Version: webpack 1.13.1 Time: 3353ms [0] multi main 64 bytes {0}
[built]
+ 739 hidden modules
ERROR in ./app/Resources/react/components/subscription/total.js Module
not found: Error: Cannot resolve module 'lodash' in
D:\Divers\Programmation\Web\foodmeup.dev\app\Resources\react\components\subscription
# ./app/Resources/react/components/subscription/total.js 19:8-25
my total.js file :
import React from 'react';
import { connect } from 'react-redux';
import { updateSubscription } from '../../actions/subscription';
var _ = require('lodash');
...
I get the following error when I launch npm run deploy
D:\Divers\Programmation\Web\foodmeup.dev>npm run deploy
FoodMeUp#1.0.0 deploy D:\Divers\Programmation\Web\foodmeup.dev
NODE_ENV=production webpack -p --config webpack.production.config.js
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 10.0.10586 npm ERR! argv
"C:\Development\nodejs\node.exe"
"C:\Development\nodejs\node_modules\npm\bin\npm-cli.js" "run"
"deploy" npm ERR! node v6.2.2 npm ERR! npm v3.9.5 npm ERR! code
ELIFECYCLE npm ERR! FoodMeUp#1.0.0 deploy: NODE_ENV=production
webpack -p --config webpack.production.config.js npm ERR! Exit status
1 npm ERR! npm ERR! Failed at the FoodMeUp#1.0.0 deploy script
'NODE_ENV=production webpack -p --config
webpack.production.config.js'. npm ERR! Make sure you have the latest
version of node.js and npm installed. npm ERR! If you do, this is most
likely a problem with the FoodMeUp package, npm ERR! not with npm
itself. npm ERR! Tell the author that this fails on your system: npm
ERR! NODE_ENV=production webpack -p --config
webpack.production.config.js npm ERR! You can get information on how
to open an issue for this project with: npm ERR! npm bugs FoodMeUp
npm ERR! Or if that isn't available, you can get their info via: npm
ERR! npm owner ls FoodMeUp npm ERR! There is likely additional
logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! D:\Divers\Programmation\Web\foodmeup.dev\npm-debug.log
and my npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Development\\nodejs\\node.exe',
1 verbose cli 'C:\\Development\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'deploy' ]
2 info using npm#3.9.5
3 info using node#v6.2.2
4 verbose run-script [ 'predeploy', 'deploy', 'postdeploy' ]
5 info lifecycle FoodMeUp#1.0.0~predeploy: FoodMeUp#1.0.0
6 silly lifecycle FoodMeUp#1.0.0~predeploy: no script for predeploy, continuing
7 info lifecycle FoodMeUp#1.0.0~deploy: FoodMeUp#1.0.0
8 verbose lifecycle FoodMeUp#1.0.0~deploy: unsafe-perm in lifecycle true
9 verbose lifecycle FoodMeUp#1.0.0~deploy: PATH: C:\Development\nodejs\node_modules\npm\bin\node-gyp-bin;D:\Divers\Programmation\Web\foodmeup.dev\node_modules\.bin;C:\Development\nodejs;C:\img;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Development\Git\cmd;C:\Program Files (x86)\Windows Live\Shared;C:\Development\wamp\bin\php\php7.0.0;C:\Net Generation\FireFox\;C:\Development\wamp\bin\mysql\mysql5.7.9\bin;C:\Program Files (x86)\Skype\Phone\;D:\Divers\Programmation\Web\foodmeup.dev\node_modules\typescript\bin;C:\Development\nodejs\;C:\Development\ruby\bin;C:\Development\wamp\bin\php\php7.0.0;C:\Development\wamp\bin\mysql\mysql5.7.9\bin;D:\Divers\Programmation\Web\foodmeup.dev\node_modules\typescript\bin;C:\img;C:\Users\Sébastien\AppData\Roaming\npm
10 verbose lifecycle FoodMeUp#1.0.0~deploy: CWD: D:\Divers\Programmation\Web\foodmeup.dev
11 silly lifecycle FoodMeUp#1.0.0~deploy: Args: [ '/d /s /c',
11 silly lifecycle 'NODE_ENV=production webpack -p --config webpack.production.config.js' ]
12 silly lifecycle FoodMeUp#1.0.0~deploy: Returned: code: 1 signal: null
13 info lifecycle FoodMeUp#1.0.0~deploy: Failed to exec deploy script
14 verbose stack Error: FoodMeUp#1.0.0 deploy: `NODE_ENV=production webpack -p --config webpack.production.config.js`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Development\nodejs\node_modules\npm\lib\utils\lifecycle.js:245:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Development\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:852:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
15 verbose pkgid FoodMeUp#1.0.0
16 verbose cwd D:\Divers\Programmation\Web\foodmeup.dev
17 error Windows_NT 10.0.10586
18 error argv "C:\\Development\\nodejs\\node.exe" "C:\\Development\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "deploy"
19 error node v6.2.2
20 error npm v3.9.5
21 error code ELIFECYCLE
22 error FoodMeUp#1.0.0 deploy: `NODE_ENV=production webpack -p --config webpack.production.config.js`
22 error Exit status 1
23 error Failed at the FoodMeUp#1.0.0 deploy script 'NODE_ENV=production webpack -p --config webpack.production.config.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the FoodMeUp package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error NODE_ENV=production webpack -p --config webpack.production.config.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs FoodMeUp
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls FoodMeUp
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
It looks like the configuration file is not 100% correct. See details below:
need to import 'webpack' mobile before using it (webpack.config.js),
i.e., const webpack = require('webpack');
need to import path module before using it (webpack.config.js),
i.e., const path = require('path');
devFlagPlugin is not defined
also exclude the node_modules directory in the loader
module: {
loaders: [
{
....
exclude: path.resolve(__dirname, 'node_modules/')
}
]
}
I think you have two different problems.
Lodash is missing?
Now, I'm not an expert in Webpack so somebody may point out something obvious that I don't see...but...when you say it doesn't work under Windows, have you tried it on multiple Windows systems?
If this issue is only on one system or it's a PITA to get onto a second box or whatever, try:
Delete the node_modules directory
Execute npm cache clean to be sure you'll start fresh when you reinstall
Re-install with npm i --verbose > npm-install-log.txt
If the install still doesn't work, you'll have an install log to review to see if something is failing to compile or there's some other wacky error that may not be visible after install.
NODE_ENV on Windows
The NODE_ENV=production <commands> syntax is a *nix thing but not a Windows/DOS thing.
In this case, you may find it easier to create a .bat file for this where you set the variable on the first line and call the command on the second. However, this won't work on *nix platforms so....maybe:
Create two scripts and two entries in package.json, one for each OS. If it's a simple project that's mostly maintained by hand, that's probably cool.
Create a deploy.js script, executed by node, that sets the NODE_ENV variable, calls webpack via the node api to do the work. This should be OS independent and is a single script...
You can set environment variables in a cross-platform manner by using cross-env:
"deploy": "cross-env NODE_ENV=production webpack -p --config webpack.production.config.js"