Failed to deploy nodejs into azure - node.js

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"
}
}

Related

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

How i can handle an error in package.json?

i m having a problem with the package.json. This is a cloned project,and and i revised the commas and they are ok. so i don't know where is the mistake.
This is what the terminal says:
npm ERR! code EJSONPARSE
npm ERR! file C:\Users\Emege\package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near ''
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse 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\Emege\AppData\Roaming\npm-cache\_logs\2020-08-22T03_04_56_980Z-debug.log.
I read this article, but it didn't help me https://dev.to/redslug/7-solutions-to-ejsonparse-or-unexpected-token-npm-install-error-20nh.
And this is the package.json
{
"name": "tvpassport",
"version": "1.0.0",
"description": "Autentificacion de usuarios",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Jean Mariños",
"license": "ISC",
"dependencies": {
"body-parser": "^1.14.1",
"connect-flash": "^0.1.1",
"connect-redis": "^3.0.1",
"express": "^4.13.3",
"express-session": "^1.12.1",
"mongoose": "^4.2.5",
"passport": "^0.3.2",
"passport-facebook": "^2.0.0",
"passport-local": "^1.0.0",
"swig": "^1.4.2"
}
}
You need only this in you package.json file:
{
"name": "tvpassport",
"version": "1.0.0",
"description": "Autentificacion de usuarios",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Jean Mariños",
"license": "ISC",
"dependencies": {
"body-parser": "^1.14.1",
"connect-flash": "^0.1.1",
"connect-redis": "^3.0.1",
"express": "^4.13.3",
"express-session": "^1.12.1",
"mongoose": "^4.2.5",
"passport": "^0.3.2",
"passport-facebook": "^2.0.0",
"passport-local": "^1.0.0",
"swig": "^1.4.2"
}
}
remove this: ````````

Webpack npm ERR Missing script: build; (WINDOWS 10)

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"
}
}

repeated EJSONPARSE error

"npm run react-dev" command gives this jsonparse error occurs repeatedly.
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token in JSON at position 595 while parsing ' {
npm ERR! "name": "reactnodetutorial",
npm ERR! "vers'
Tried the following but none worked.
1) deleted all directories and files and restarted this project from the scratch like building architecture and installing dependencies
2) deleted all contents in package.json file and copied the tutorial example's package.json contents which is perfect and pasted it to mine
3) update node and npm to the latest version
4) npm init and reinstall dependencies
5) npm cache clean --force
6) rm -f package-lock.json
How to possibly fix this.
My package.json file is as follows:
{
"name": "reactnodetutorial",
"version": "1.0.0",
"description": "",
"main": "webpack.config.js",
"dependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"body-parser": "^1.18.2",
"express": "^4.16.3",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-router": "^4.2.0",
"react-router-dom": "^4.2.2",
"webpack": "^4.1.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack -d --watch",
"start": "node ./server/index.js",
"build": "webpack -p",
"react-dev": "webpack -d --watch",
"server-dev": "nodemon server/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/shinjehere/reactNodeTutorial.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/shinjehere/reactNodeTutorial/issues"
},
"homepage": "https://github.com/shinjehere/reactNodeTutorial#readme"
}

Issues with NPM : npm ERR! Failed to parse json npm ERR! No data, empty input at 1:1

I am trying to run a project on my local.I have installed npm and nodejs in my computer and try to set the project.
The issues arose when I run npm install for the first time.
The error message is:
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "/usr/bin/nodejs" "/home/aaa/bin/npm" "install"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! file /home/aaa/.npm/asynckit/0.4.0/package/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! No data, empty input at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: /home/aaa/.npm/asynckit/0.4.0/package/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse
And my package.json file is :
```
{
"name": "babel-with-gulp",
"version": "1.0.0",
"description": "Starter code for using Babel with Gulp",
"main": "index.js",
"scripts": {
"test": "jest",
"start": "gulp watch"
},
"author": "Carlos Souza <carloshrsouza#gmail.com> (http://csouza.me/)",
"license": "ISC",
"repository": {
"type": "git",
"url": "git+ssh://git#github.com/codeschool/babel-with-gulp.git"
},
"keywords": [
"babel",
"gulp",
"es2015"
],
"bugs": {
"url": "https://github.com/codeschool/babel-with-gulp/issues"
},
"homepage": "https://github.com/codeschool/babel-with-gulp#readme",
"devDependencies": {
"babel-core": "^6.7.6",
"babel-jest": "^15.0.0",
"babel-polyfill": "^6.13.0",
"babel-preset-es2015": "^6.14.0",
"babel-preset-react": "^6.11.1",
"babel-preset-stage-1": "^6.13.0",
"babel-register": "^6.7.2",
"babelify": "^7.2.0",
"browser-sync": "^2.11.2",
"browserify": "^12.0.1",
"eslint": "^2.7.0",
"eslint-plugin-react": "^4.2.3",
"exorcist": "^0.4.0",
"gulp": "^3.9.0",
"gulp-eslint": "^2.0.0",
"gulp-if-else": "^1.0.3",
"gulp-imagemin": "^3.0.3",
"gulp-uglify": "^1.5.3",
"jest": "^15.1.1",
"jquery": "^2.2.2",
"react": "^15.0.1",
"react-dom": "^15.0.1",
"react-router": "^2.7.0",
"react-test-renderer": "^15.3.1",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"watchify": "^3.7.0"
},
"dependencies": {
"immutable": "^3.8.1",
"material-ui": "^0.15.4",
"react-addons-css-transition-group": "^15.3.1",
"react-bootstrap": "^0.30.3",
"react-player": "^0.9.0",
"react-redux": "^4.4.5",
"react-tap-event-plugin": "^1.0.0",
"redux": "^3.6.0"
}
}
```
Did I missed any prerequisite to run the code? or is there any compatibility issue? I have node (4.4.5) version and npm (2.15.5).
Clean the cache first with npm cache clean and then you can run the command without any errors.

Resources