Webpack npm ERR Missing script: build; (WINDOWS 10) - node.js

My bf and I were making a haiku checker during school today. Everything was working fine but when I cloned his repo i'm getting a "npm ERR! missing script: build;" on my windows 10 PC
Any help will be much appreciated and I can provide more info
Additional errors
npm ERR! Haiku#1.0.0 start: `npm run build; webpack-dev-server --open --mode development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Haiku#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Here is my package.json
{
"name": "Haiku",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "karma start karma.conf.js",
"build": "webpack --mode development",
"start": "npm run build; webpack-dev-server --open --mode development",
"lint": "eslint src/*.js --fix"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.3",
"babel-preset-es2015": "^6.24.1",
"clean-webpack-plugin": "^0.1.18",
"css-loader": "^0.28.10",
"eslint": "^4.18.2",
"eslint-loader": "^2.0.0",
"html-webpack-plugin": "^3.0.6",
"jasmine": "^3.1.0",
"jasmine-core": "^2.99.0",
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-jquery": "^0.2.2",
"karma-webpack": "^2.0.13",
"style-loader": "^0.20.2",
"uglifyjs-webpack-plugin": "^1.2.2",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.9",
"webpack-dev-server": "^3.1.0"
},
"dependencies": {
"bootstrap": "^4.0.0",
"jquery": "^3.3.1",
"popper.js": "^1.14.1",
"syllable": "^3.0.0"
}
}

Related

Vuejs Module not found: Error: Can't resolve '../dist/helpers.esm' in node_modules/chart.js/helpers

I am trying to run npm run dev on one of my projects and getting **Module not found: Error: Can't resolve '../dist/helpers.esm' in node_modules/chart.js/helpers
You can see here => https://i.stack.imgur.com/wZc3o.png
Package.json
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production",
"serve": "php artisan serve",
"clear-cache": "php artisan optimize:clear && composer dump-autoload && composer cc && npm cache clean --force"
},
"devDependencies": {
"axios": "^0.21.1",
"bootstrap": "^4.0.0",
"cross-env": "^5.2.1",
"jquery": "^3.2",
"laravel-mix": "^6.0.43",
"lodash": "^4.17.5",
"popper.js": "^1.12",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^12.6.0",
"vue": "^2.5.7",
"vue-loader": "^15.9.8"
},
"dependencies": {
"chart.js": "^3.8.0",
"chartjs-plugin-datalabels": "^2.0.0",
"css-percentage-circle": "^2.0.1",
"echarts": "^5.3.2",
"jspdf": "^2.3.1",
"jspdf-autotable": "^3.5.15",
"laravel-echo": "^1.11.7",
"moment": "^2.29.1",
"moment-timezone": "^0.5.32",
"node-sass": "^7.0.1",
"npm": "^8.6.0",
"pdf-lib": "^1.17.1",
"percircle": "^1.0.28",
"percircle-vue": "^0.1.2",
"pusher-js": "^7.1.0-beta",
"tinymce": "^5.7.1",
"v-charts": "^1.17.10",
"v-skeletor": "^0.0.4",
"v-slim-dialog": "0.0.10",
"vue-axios": "^2.1.4",
"vue-chartjs": "^4.0.0",
"vue-codemirror": "^4.0.6",
"vue-confirm-dialog": "^1.0.2",
"vue-css-percentage-circle": "^2.0.0",
"vue-js-modal": "^2.0.1",
"vue-month-picker": "^1.5.0",
"vue-multiselect": "^2.1.6",
"vue-router": "^3.4.9",
"vue-step-progress": "^0.3.7",
"vue-tinymce-editor": "^1.6.2",
"vue-toast-notification": "^0.6.2",
"vue2-daterange-picker": "^0.6.8",
"vuedraggable": "^2.24.3",
"vuejs-datepicker": "^1.6.2",
"vuejs-dialog": "^1.4.2",
"vuex-persistedstate": "^3.0.0",
"yan-progress": "^1.0.3"
}
}
Node version install on my system is 18.0.0 and npm is 8.6.0
It was working just fine but now its not

webpack-cli Error: Unknown option '--no-progress'

I am facing some errors during refactoring an old project. also, this project is upgraded from laravel 5.8 to 6.0 laravel. but most likely it is failing during npm run prod. I wonder what is happening. just before the upgrade it was fine.
[webpack-cli] Error: Unknown option '--no-progress'
[webpack-cli] Run 'webpack --help' to see available commands and options
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # production: `cross-env NODE_ENV=production node_modules/webpack/bin/w ebpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/w ebpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # production script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2021-05-27T12_01_52_782Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # prod: `npm run production`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # prod script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2021-05-27T12_01_52_797Z-debug.log
so my package .json will look like this:
{
"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",
"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": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"resolutions": {
"minimist": "^1.2.5"
},
"dependencies": {
"#expo/vector-icons": "^10.2.1",
"#fortawesome/fontawesome-svg-core": "^1.2.35",
"#fortawesome/free-solid-svg-icons": "^5.15.3",
"#fortawesome/react-fontawesome": "^0.1.14",
"#material-ui/core": "^4.11.4",
"#material-ui/icons": "^4.11.2",
"#material-ui/lab": "^4.0.0-alpha.58",
"#mdi/font": "^4.9.95",
"#react-pdf/renderer": "^1.6.16",
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.3.2",
"#testing-library/user-event": "^7.1.2",
"#trendmicro/react-sidenav": "^0.5.0",
"#vue/cli": "^4.5.13",
"braces": "^2.3.2",
"canvasjs": "^1.8.3",
"core-js": "^2.6.12",
"crypto-js": "^4.0.0",
"express": "^4.17.1",
"firebase": "^8.6.2",
"font-awesome": "^4.7.0",
"fs": "0.0.1-security",
"jquery": "^3.6.0",
"lodash": "^4.17.21",
"material-design-icons-iconfont": "^5.0.1",
"material-ui": "^0.20.2",
"material-ui-icons": "^1.0.0-beta.36",
"material-ui-password-field": "^2.1.2",
"mdbvue": "^6.7.2",
"module": "^1.2.5",
"msg91": "0.0.6",
"node-sass": "^4.14.1",
"pondjs": "^0.9.0",
"pug-plain-loader": "^1.1.0",
"react-circular-progressbar": "^2.0.4",
"react-custom-radio": "^1.0.7",
"react-feather": "^2.0.9",
"react-google-charts": "^3.0.15",
"react-move": "^6.4.0",
"react-native-vector-icons": "^6.7.0",
"react-pdf": "^4.2.0",
"react-progressbar": "^15.4.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
"react-signature-canvas": "^1.0.3",
"react-simple-dropdown": "^3.2.3",
"react-timeseries-charts": "^0.16.1",
"react-toastify": "^5.5.0",
"react-vis": "^1.11.7",
"recharts": "^2.0.9",
"styled-components": "^5.3.0",
"vue": "^2.6.12",
"vue-awesome-swiper": "^4.1.1",
"vue-axios": "^2.1.5",
"vue-chartist": "^2.3.1",
"vue-ckeditor2": "^2.1.5",
"vue-click-outside": "^1.1.0",
"vue-custom-scrollbar": "^1.4.0",
"vue-easy-slider": "^5.3.4",
"vue-event-hub": "^1.0.3",
"vue-kanban": "^1.8.0",
"vue-loader": "^16.2.0",
"vue-picture-input": "^2.1.6",
"vue-plyr": "^5.1.3",
"vue-resizable": "^1.3.0",
"vue-router": "^3.5.1",
"vue-smooth-dnd": "^0.8.0",
"vue-split-panel": "^1.0.4",
"vue-template-compiler": "^2.6.12",
"vue-video": "^0.1.7",
"vue2-editor": "^2.10.2",
"vueditor": "^0.3.1",
"vuescroll": "^4.17.3",
"vuetify-media-player": "^0.8.1",
"vuex": "^3.6.2",
"watch": "^1.0.2",
"write-json-file": "^4.3.0"
},
"devDependencies": {
"#babel/plugin-proposal-class-properties": "^7.13.0",
"#babel/preset-react": "^7.13.13",
"#fortawesome/fontawesome-free": "^5.15.3",
"#vue/cli-plugin-babel": "^3.11.0",
"#vue/cli-plugin-eslint": "^4.5.13",
"#vue/cli-service": "^4.5.13",
"axios": "^0.21.1",
"babel-eslint": "^10.1.0",
"cross-env": "^5.2.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"laravel-mix": "^6.0.19",
"minimist": "^1.2.5",
"pug": "^3.0.2",
"pug-loader": "^2.4.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"resolve-url-loader": "^4.0.0",
"sass": "^1.34.0",
"sass-loader": "^7.1.0",
"stylus": "^0.54.8",
"stylus-loader": "^3.0.2",
"vue-cli-plugin-vuetify": "^0.6.3",
"vuetify": "^2.5.1",
"vuetify-loader": "^1.7.2",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {
"no-mixed-spaces-and-tabs": 0,
"no-irregular-whitespace": 0
},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": []
}
},
"browserslist": [
"> 1%",
"last 2 versions"
],
"description": "## Project setup ``` npm install ```",
"main": "babel.config.js",
"keywords": [],
"author": "",
"license": "ISC"
}
my webpack.mix.js
const mix = require('laravel-mix');
mix.webpackConfig({
module: {
rules: [{
test: /\.pug$/,
oneOf: [{
resourceQuery: /^\?vue/,
use: ['pug-plain-loader']
},
{
use: ['raw-loader', 'pug-plain-loader']
},
{
// Exclude `js` files to keep "css" loader working as it injects
// it's runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.js$/, /\.html$/, /\.json$/, /\.ejs$/],
loader: require.resolve('file-loader'),
options: {
name: 'static/media/[name].[hash:8].[ext]',
}
}
]
}]
}
});
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.react('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
thanks in advance
looking for some valuable suggestions

Failed to deploy nodejs into azure

I am trying to deploy my web apps to azure web apps via azure apps in vscode, but when I try to deploy and I check the results it came out ':( Application Error'. How can I deploy successfully? and I check stream log this is the result :
2020-02-21T13:50:37.648590306Z npm ERR! errno ENOENT
2020-02-21T13:50:37.651449357Z npm ERR! script#1.0.0 start: `npx babel src -s -D -d dist && node dist/main.js`
2020-02-21T13:50:37.652176195Z npm ERR! spawn ENOENT
2020-02-21T13:50:37.652917034Z npm ERR!
2020-02-21T13:50:37.653579369Z npm ERR! Failed at the script#1.0.0 start script.
2020-02-21T13:50:37.654141399Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-02-21T13:50:37.660881655Z
2020-02-21T13:50:37.661645395Z npm ERR! A complete log of this run can be found in:
2020-02-21T13:50:37.662200124Z npm ERR! /root/.npm/_logs/2020-02-21T13_50_37_655Z-debug.log
can someone help me ? how to make
this my package json :
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "npx babel src -s -D -d dist && node dist/main.js",
"build": "npx babel src -s -D -d dist",
"dev": "nodemon --exec babel-node src/main.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.19.2",
"body-parser": "^1.19.0",
"dotenv": "^8.2.0",
"ejs": "^3.0.1",
"express": "^4.17.1",
"express-handlebars": "^3.1.0",
"express-recaptcha": "^5.0.1",
"form-data": "^3.0.0",
"moment": "^2.24.0",
"multer": "^1.4.2",
"node-fetch": "^2.6.0",
"php-serialize": "^3.0.1",
"request": "^2.88.2",
"request-promise": "^4.2.5",
"store": "^2.0.12",
"streamifier": "^0.1.1",
"url": "^0.11.0",
"util": "^0.12.1"
},
"devDependencies": {
"#babel/cli": "^7.6.2",
"#babel/core": "^7.6.2",
"#babel/node": "^7.6.2",
"#babel/plugin-transform-runtime": "^7.6.2",
"#babel/preset-env": "^7.6.2",
"#babel/preset-flow": "^7.0.0",
"#babel/runtime": "^7.6.2",
"babel-core": "^7.0.0-bridge.0",
"babel-node": "0.0.1-security",
"babel-polyfill": "^6.26.0"
}
}

Angular App not deployong on Heroku

I'm trying to deploy an angular 2 application on Heroku, and I followed a guide and keep getting this error. The error is probably about the postinstall, but I need the postinstall for deployment I read. I have already npm installed #angular/cli#latest Any one have an idea?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.7.2 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.7.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
Below is my package.json
{
"name": "mars-colony",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "node server.js",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"postinstall":"ng build --aot --target=production"
} ,
"private": true,
"dependencies": {
"#angular/common": "^2.4.0",
"#angular/cli": "1.0.0-rc.0",
"#angular/compiler-cli": "^2.4.0",
"#angular/compiler": "^2.4.0",
"#angular/core": "^2.4.0",
"#angular/forms": "^2.4.0",
"#angular/http": "^2.4.0",
"#angular/platform-browser": "^2.4.0",
"#angular/platform-browser-dynamic": "^2.4.0",
"#angular/router": "^3.4.0",
"core-js": "^2.4.1",
"ng2-page-transition": "^1.0.4",
"rxjs": "^5.1.0",
"typescript": "~2.0.0",
"web-animations-js": "^2.2.2",
"zone.js": "^0.7.6"
},
"devDependencies": {
"#types/jasmine": "2.5.38",
"#types/node": "~6.0.60",
"codelyzer": "~2.0.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.4.1",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.0",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.5.0",
"protractor": "~5.1.0",
"ts-node": "~2.0.0",
"tslint": "~4.4.2"
},
"engines": {
"node": "8.9.4",
"npm": "5.6.0"
}
}
I am not too familiar with node, but everything seems to be set up correctly like the guide has said. Below is my repo
https://github.com/edwardlanto/mars-heroku
Thank you!

Error in package.json deploying Angular2 project on Azure using bitbucket

I am facing a issue deploying angular2 app on azure. I get an error on following line
"engines":{"node":"6.2.1"},
I have given this version as WEBSITE_NODE_DEFAULT_VERSION has the value 6.2.1. Anyone having idea about this then please share.
Here is the error snapshot:
package.json looks as follows:
{
"name": "angular-quickstart",
"version": "1.0.0",
"engines":{"node":"6.2.1"},
"description": "QuickStart package.json from the documentation, supplemented with testing support",
"scripts": {
"start": "tsc && concurrently \"tsc -w\" \"lite-server\" ",
"docker-build": "docker build -t ng2-quickstart .",
"docker": "npm run docker-build && docker run -it --rm -p 3000:3000 -p 3001:3001 ng2-quickstart",
"pree2e": "npm run webdriver:update",
"e2e": "tsc && concurrently \"http-server -s\" \"protractor protractor.config.js\" --kill-others --success first",
"lint": "tslint ./app/*/.ts -t verbose",
"lite": "node_modules\.bin\lite-server",
"postinstall": "typings install",
"test": "tsc && concurrently \"tsc -w\" \"karma start karma.conf.js\"",
"test-once": "tsc && karma start karma.conf.js --single-run",
"tsc": "node_modules\.bin\tsc",
"concurrently": "node_modules\.bin\concurrently",
"tsc:w": "node_modules\.bin\tsc -w",
"typings": "node_modules\.bin\typings",
"webdriver:update": "webdriver-manager update"
},
"keywords": [],
"author": "",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/angular/angular.io/blob/master/LICENSE"
}
],
"dependencies": {
"#angular/common": "~2.1.0",
"#angular/compiler": "~2.1.0",
"#angular/core": "~2.1.0",
"#angular/forms": "~2.1.0",
"#angular/http": "~2.1.0",
"#angular/platform-browser": "~2.1.0",
"#angular/platform-browser-dynamic": "~2.1.0",
"#angular/router": "~3.1.0",
"#angular/upgrade": "~2.1.0",
"angular-in-memory-web-api": "~0.1.5",
"bootstrap": "^3.3.7",
"systemjs": "0.19.39",
"core-js": "^2.4.1",
"reflect-metadata": "^0.1.8",
"rxjs": "5.0.0-beta.12",
"zone.js": "^0.6.25",
"concurrently": "^3.0.0",
"lite-server": "^2.2.2",
"typescript": "^2.0.3",
"typings": "^1.4.0"
},
"devDependencies": {
"concurrently": "^3.0.0",
"lite-server": "^2.2.2",
"typescript": "^2.0.3",
"typings": "^1.4.0",
"canonical-path": "0.0.2",
"http-server": "^0.9.0",
"tslint": "^3.15.1",
"lodash": "^4.16.2",
"jasmine-core": "~2.5.2",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-htmlfile-reporter": "^0.3.4",
"karma-jasmine": "^1.0.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^3.3.0",
"rimraf": "^2.5.4"
},
"repository": {}
}
Please suggest a solution.
When you deploy your app in a server or a cloud, you should run it on a port provided with process.env.PORT, here is an example:
app.listen(process.env.PORT || 3000, () => {
console.log('Example app is running!');
});
in your package.json file the start script is setting the app to run on port 3000 by default.
From Angular js2 Documentary:
If Node.js and npm aren't already on your machine, install them. Our examples require node v4.x.x or higher and npm 3.x.x or higher. To check which version you are using, run node -v and npm -v in a terminal window.
Could you please check your npm version?

Resources