Laravel 8 Mix npm run development error with vue.js - node.js

I've laravel Vue js project. I need to make changes to our project but when I try to use npm run development to reflect my changes but I got the below-mentioned error in Mac System.
fleetcart# dev /home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com
> npm run development
> fleetcart# development /home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist#latest --update-db
Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating
/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/Themes/Storefront/node_modules/webpack/lib/NormalModule.js:207
throw new TypeError(
^
TypeError: The 'compilation' argument must be an instance of Compilation
at Function.getCompilationHooks (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/Themes/Storefront/node_modules/webpack/lib/NormalModule.js:207:10)
at /home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/Themes/Storefront/node_modules/mini-css-extract-plugin/dist/index.js:394:103
at SyncHook.eval [as call] (eval at create (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
at SyncHook.lazyCompileHook (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/tapable/lib/Hook.js:154:20)
at Compiler.newCompilation (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack/lib/Compiler.js:631:26)
at /home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack/lib/Compiler.js:667:29
at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
at AsyncSeriesHook.lazyCompileHook (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/tapable/lib/Hook.js:154:20)
at Compiler.compile (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack/lib/Compiler.js:662:28)
at /home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack/lib/Compiler.js:321:11
at Compiler.readRecords (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack/lib/Compiler.js:529:11)
at /home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack/lib/Compiler.js:318:10
at eval (eval at create (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at /home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack/lib/CachePlugin.js:50:13
at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:5:1)
at AsyncSeriesHook.lazyCompileHook (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/tapable/lib/Hook.js:154:20)
at /home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack/lib/Compiler.js:315:19
at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1)
at AsyncSeriesHook.lazyCompileHook (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/tapable/lib/Hook.js:154:20)
at Compiler.run (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack/lib/Compiler.js:312:24)
at processOptions (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack-cli/bin/cli.js:353:14)
at /home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack-cli/bin/cli.js:364:3
at Object.parse (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack-cli/node_modules/yargs/yargs.js:576:18)
at /home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack-cli/bin/cli.js:49:8
at Object.<anonymous> (/home/virtual/vps-e25466/2/2c563f2522/staging.pnutso.com/node_modules/webpack-cli/bin/cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fleetcart# development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fleetcart# development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/virtual/vps-e25466/2/2c563f2522/.npm/_logs/2022-11-11T12_21_33_478Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fleetcart# dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fleetcart# dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/virtual/vps-e25466/2/2c563f2522/.npm/_logs/2022-11-11T12_21_33_490Z-debug.log
Below is my package.json file:
{
"name": "fleetcart",
"private": true,
"scripts": {
"rtlcss": "rtlcss",
"postinstall": "lerna bootstrap",
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"#babel/preset-env": "^7.19.4",
"cross-env": "^6.0.2",
"eslint": "^8.26.0",
"eslint-config-spatie": "^2.0.3",
"eslint-plugin-import": "^2.26.0",
"glob": "^7.2.3",
"laravel-mix": "^6.0.49",
"laravel-mix-merge-manifest": "^0.1.2",
"lerna": "^6.0.2",
"rtlcss": "^4.0.0",
"sass": "^1.56.0",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.7.13",
"webpack-shell-plugin": "^0.5.0"
},
"dependencies": {
"webpack": "^5.74.0"
}
}
Earlier when I run npm run dev cmd then getting some strange error related to the library version mismatch error so I updated Laravel-Mix lib to 6.0.12 and try to run but after too much research, not get any results.
I removed the node_modules, package.json file from the root folder and then again reinstalled it, but nothing happened.
I used the below-mentioned command in the development script:
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js
Please let me know if anyone has an idea to reflect my changes to live server after npme run dev command.
Thank You in advance.

Related

npm ERR! code ELIFECYCLE is being displayed while running "npn start" on window command line for the following package.json file

I am learning full stack web development with Angular and new to web deployment.I am unable to guess the reason behind this npm ERR! code ELIFECYCLE; displayed while running "npn start" on window command line for the following package.json file. I am stuck here and not much help available on google or I am unable to search right answer because of lack of proper keyword required to search the answer.
{
"name": "confusion",
"version": "1.0.0",
"description": "This is a website for Ristorante Con Fusion",
"main": "index.html",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm run watch:all",
"lite": "lite-server",
"scss": "node-sass -o css/ css/",
"watch:scss": "onchange \"css/*.scss\" -- npm run scss",
"watch:all": "parallelshell \"npm run watch:scss\" \"npm run lite\""
},
"author": "Imtiaz",
"license": "ISC",
"devDependencies": {
"lite-server": "^2.3.0",
"node-sass": "^4.13.1",
"onchange": "^3.3.0",
"parallelshell": "^3.0.2"
},
"dependencies": {
"bootstrap": "^4.0.0",
"bootstrap-icons": "^1.0.0-alpha2",
"bootstrap-social": "^5.1.1",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"popper.js": "^1.12.9"
}
}
OutPut:
C:\Users\NEW WS-08\Bootstrap4\conFusion>npm start
> confusion#1.0.0 start C:\Users\NEW WS-08\Bootstrap4\conFusion
> npm run watch:all
> confusion#1.0.0 watch:all C:\Users\NEW WS-08\Bootstrap4\conFusion
> parallelshell "npm run watch:scss" "npm run lite"
child_process.js:422
throw new ERR_INVALID_ARG_TYPE('options.cwd', 'string', options.cwd);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "options.cwd" property must be of type str
ing. Received type function
←[90m at normalizeSpawnArguments (child_process.js:422:11)←[39m
←[90m at spawn (child_process.js:534:16)←[39m
at C:\Users\NEW WS-08\Bootstrap4\conFusion\node_modules\←[4mparallelshell←[2
4m\index.js:104:17
at Array.forEach (<anonymous>)
at Object.<anonymous> (C:\Users\NEW WS-08\Bootstrap4\conFusion\node_modules\
←[4mparallelshell←[24m\index.js:100:6)
←[90m at Module._compile (internal/modules/cjs/loader.js:955:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10
)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:811:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:723:14)←[39m
←[90m at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)←[39
m {
code: ←[32m'ERR_INVALID_ARG_TYPE'←[39m
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! confusion#1.0.0 watch:all: `parallelshell "npm run watch:scss" "npm run
lite"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the confusion#1.0.0 watch:all 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! C:\Users\NEW WS-08\AppData\Roaming\npm-cache\_logs\2020-03-26T08_26
_18_785Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! confusion#1.0.0 start: `npm run watch:all`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the confusion#1.0.0 start 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! C:\Users\NEW WS-08\AppData\Roaming\npm-cache\_logs\2020-03-26T08_26
_18_841Z-debug.log
This is a common issue can not be fixed using npm audit fix. All you can do is to copy the actual index.js file of parallelshell into your node_modules directory.
So to do it below are the instructions:
1. Go to https://raw.githubusercontent.com/darkguy2008/parallelshell/master/index.js
2. Copy the content here.
3. Now go to the directory of your project, it may be something like /project/node_modules/parallelshell/index.js
4. Inside the index.js replace the contents with the one you copied from the link in Step 1.
5. Save the file and exit.
Hope this fix will work for you.

Unable to deploy application on heroku

I am receiving the following error while deploying my application on heroku, I have deployed it before with no problems. I also have not changed the package.json file, so I am unsure why I am getting the following error.
There are no additional configs for heroku, the application was previously deployed, and cannot be updated.
The application is deployed currently under a previous version through the heroku website from my github.
Any help to resolve this issue would be greatly appreciated!
error from heroku
-----> Build
Running heroku-postbuild
> operations-reporting#1.0.0 heroku-postbuild /tmp/build_04594e22478b41fb98f830b9b12c2400
> NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
added 86 packages from 287 contributors and audited 906755 packages in 16.658s
found 2 moderate severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
> client#0.1.0 build /tmp/build_04594e22478b41fb98f830b9b12c2400/client
> react-scripts build
internal/modules/cjs/loader.js:800
throw err;
^
Error: Cannot find module 'es-abstract/2019/CreateDataProperty'
Require stack:
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/index.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/implementation.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/index.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/html-webpack-plugin/index.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/config/webpack.config.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/scripts/build.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js:3:26)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/index.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/implementation.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/index.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/html-webpack-plugin/index.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/config/webpack.config.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/scripts/build.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.PQkmQ/_logs/2019-12-14T21_42_39_533Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! operations-reporting#1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the operations-reporting#1.0.0 heroku-postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.PQkmQ/_logs/2019-12-14T21_42_39_547Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- node_modules checked into source control
https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
package.json
{
"name": "client",
"version": "0.1.0",
"main": "index.js",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"config": "^3.2.4",
"express": "^4.17.1",
"express-validator": "^6.3.0",
"formik": "^2.0.6",
"mongoose": "^5.7.12",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.2.0",
"react-table": "^6.10.3",
"reactstrap": "^8.1.1",
"schema-utils": "^2.6.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"concurrently": "^5.0.0",
"nodemon": "^2.0.1"
},
"proxy": "http://localhost:5000"
}
Find the missing module and update your package like so:
npm install --save --save-exact foo#1.2.3
This is from heroku
Other solution:
heroku config:set NODE_MODULES_CACHE=false

Endless Loop: Cannot find 'cross-spawn'

Problem
I am stuck in a loop where running npm run watch says it cannot find cross-spawn.
> # watch /Users/donnie/Github/laravel_project
> npm run development -- --watch
> # development /Users/donnie/Github/laravel_project
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"
module.js:549
throw err;
^
Error: Cannot find module 'cross-spawn'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/donnie/.yarn-cache/npm-cross-env-5.2.0/dist/index.js:5:19)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # 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 ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/donnie/.npm/_logs/2019-01-22T21_57_39_199Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch: `npm run development -- --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/donnie/.npm/_logs/2019-01-22T21_57_39_227Z-debug.log
I run npm i --D cross-spawn which is successful, then npm run watch again. It says there are a few more dependencies that must be installed (which is strange because the first thing I did was npm install.) Anyway, it finally provides this feedback:
Okay, done. The following packages have been installed and saved to your package.json dependencies list:
- vue-template-compiler
- sass-loader#7.*
- sass
- resolve-url-loader#2.3.1
Finished. Please run Mix again.
Cool. So I run npm run watch again and we're right back to the cross-spawn problem.
I've tried deleting /node_modules and starting fresh. No luck.
🤔
package.json
{
"devDependencies": {
"axios": "^0.18",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"cross-spawn": "^6.0.5"
"false": "^0.0.4",
"jquery": "^3.2",
"laravel-mix": "^4.0.7",
"lodash": "^4.17.5",
"popper.js": "^1.12",
"resolve-url-loader": "2.3.1",
"sass": "^1.16.1",
"sass-loader": "7.*",
"vue": "^2.5.17",
"vue-template-compiler": "^2.5.22"
},
"dependencies": {}
}
Environment
npm: 6.3.0
laravel: 5.7
Running npm rebuild then npm install should fix the problem. Now, running npm run dev should build fine.
I believe this issue has something to do with bad file permissions and npm rebuild seems to sort things out.
Ran into a similar issue with craco.
The following fixed it for me:
rm -rf node_modules
rm package-lock.json
npm install
Edit: I should mention that this is less than optimal. Removing your lock file is generally a bad idea and can result in dependency conflicts. In my specific case, it didn't matter, but it may matter in yours. Take precautions if you plan on applying this "fix" (create a backup if you don't use git).

yarn run dev - cross-env: Permission denied

My dev environment is Vagrant ScotchBox, Node 6.6.2, Npm 3.9.5.
I'm trying to compile the assets of my Laravel project using Mix.
yarn install
yarn run dev
With yarn run dev i get sh: 1: cross-env: Permission denied
sh: 1: cross-env: Permission denied
npm ERR! Linux 3.13.0-55-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v6.2.2/bin/node" "/home/vagrant/.nvm/versions/node/v6.2.2/bin/npm" "run" "development"
npm ERR! node v6.2.2
npm ERR! npm v3.9.5
npm ERR! code ELIFECYCLE
npm ERR! # development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 126
npm ERR!
npm ERR! Failed at the # development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.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 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/public/your-weedelivero/npm-debug.log
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c npm run development
Directory: /var/www/public/your-weedelivero
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/var/www/public/your-weedelivero/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Please, someone can help me?
Regards
/////////////////
maybe my package.json is wrong
{
"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": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"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"
},
"devDependencies": {
"axios": "^0.17",
"bootstrap-sass": "^3.3.7",
"cross-env": "^5.1.3",
"jquery": "^3.2",
"laravel-mix": "^1.0",
"lodash": "^4.17.4",
"vue": "^2.5.7"
}
}
I Had this problem in my ubuntu 16.04.
for me, it fixes the problem
first, get into your directory in terminal and enter below command.
npm rebuild
I just remove the Nodejs and install the latest version of Nodejs and now I don't have this problem anymore
Laravel Mix "sh: 1: cross-env: not found error"

package.json start script, babel-node: not found on heroku deploy

When I run heroku local or when I just do npm start locally, my app builds and runs fine. However when I deploy to heroku, the app crashes saying it cannot find babel-node.
Here is the log output:
2016-04-21T22:20:44.320025+00:00 heroku[api]: Deploy 5d9a9da by eagsalazar#gmail.com
2016-04-21T22:20:44.320084+00:00 heroku[api]: Release v9 created by eagsalazar#gmail.com
2016-04-21T22:20:44.542062+00:00 heroku[slug-compiler]: Slug compilation started
2016-04-21T22:20:44.542069+00:00 heroku[slug-compiler]: Slug compilation finished
2016-04-21T22:20:44.501025+00:00 heroku[web.1]: State changed from crashed to starting
2016-04-21T22:20:46.278065+00:00 heroku[web.1]: Starting process with command `npm start`
2016-04-21T22:20:50.467407+00:00 app[web.1]:
2016-04-21T22:20:50.467434+00:00 app[web.1]: > qc-server#1.0.0 start /app
2016-04-21T22:20:50.467435+00:00 app[web.1]: > babel-node index.js
2016-04-21T22:20:50.467436+00:00 app[web.1]:
2016-04-21T22:20:50.479490+00:00 app[web.1]: sh: 1: babel-node: not found
2016-04-21T22:20:50.521936+00:00 app[web.1]:
2016-04-21T22:20:50.538822+00:00 app[web.1]: npm ERR! Linux 3.13.0-79-generic
2016-04-21T22:20:50.539334+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-04-21T22:20:50.539595+00:00 app[web.1]: npm ERR! node v5.10.1
2016-04-21T22:20:50.555119+00:00 app[web.1]: npm ERR! npm v3.8.3
2016-04-21T22:20:50.555339+00:00 app[web.1]: npm ERR! file sh
2016-04-21T22:20:50.555549+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-04-21T22:20:50.555769+00:00 app[web.1]: npm ERR! errno ENOENT
2016-04-21T22:20:50.555965+00:00 app[web.1]: npm ERR! syscall spawn
2016-04-21T22:20:50.556142+00:00 app[web.1]: npm ERR! qc-server#1.0.0 start: `babel-node index.js`
2016-04-21T22:20:50.556305+00:00 app[web.1]: npm ERR! spawn ENOENT
2016-04-21T22:20:50.556488+00:00 app[web.1]: npm ERR!
2016-04-21T22:20:50.556666+00:00 app[web.1]: npm ERR! Failed at the qc-server#1.0.0 start script 'babel-node index.js'.
2016-04-21T22:20:50.556854+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2016-04-21T22:20:50.557017+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the qc-server package,
2016-04-21T22:20:50.557175+00:00 app[web.1]: npm ERR! not with npm itself.
2016-04-21T22:20:50.557343+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-04-21T22:20:50.557564+00:00 app[web.1]: npm ERR! babel-node index.js
2016-04-21T22:20:50.557741+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2016-04-21T22:20:50.557916+00:00 app[web.1]: npm ERR! npm bugs qc-server
2016-04-21T22:20:50.558110+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2016-04-21T22:20:50.558306+00:00 app[web.1]: npm ERR! npm owner ls qc-server
2016-04-21T22:20:50.558492+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2016-04-21T22:20:50.563859+00:00 app[web.1]:
2016-04-21T22:20:50.567790+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-04-21T22:20:50.568004+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-04-21T22:20:51.824822+00:00 heroku[web.1]: State changed from starting to crashed
2016-04-21T22:20:51.808246+00:00 heroku[web.1]: Process exited with status 1
My package.json:
{
"name": "qc-server",
"version": "1.0.0",
"description": "xxxx",
"main": "index.js",
"scripts": {
"test": "mocha --compilers js:babel-core/register --require ./test/test_helper.js 'test/**/*.js'",
"test:watch": "npm run test -- --watch -G",
"start": "babel-node index.js"
},
"babel": {
"presets": [
"es2015"
]
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.6.0",
"babel-core": "^6.6.0",
"babel-eslint": "^5.0.0",
"babel-preset-es2015": "^6.6.0",
"chai": "^3.5.0",
"chai-immutable": "^1.5.3",
"eslint": "^2.2.0",
"eslint-config-airbnb": "^6.0.2",
"eslint-plugin-react": "^4.1.0",
"mocha": "^2.4.5"
},
"dependencies": {
"express": "^4.13.4",
"immutable": "^3.7.6",
"node-uuid": "^1.4.7",
"redux": "^3.3.1",
"socket.io": "^1.4.5"
}
}
Anyone have suggestions?
You have to include the dependency in you package.json so it will install it when you deploy.
$ npm install babel-cli -S
Than you have to change you start command to be like:
"start": "babel-node index.js"
See here for more info on deploying babel on heroku.com.
Warning: using babel-node is not recommended in production
I got the same issue, but I think set NPM_CONFIG_PRODUCTION=false to install devDependencies will be better. I used below command:
heroku config:set NPM_CONFIG_PRODUCTION=false
Specifically, include the necessary dependency under 'dependencies' and not 'devDependencies' in your 'package.json file'. This is because Heroku prunes (removes) your 'devDependencies' once it completes its build process, leaving only the 'dependencies', to keep the app as lean as possible.
This causes errors if you've built your NodeJS app using ES6 modules and included the necessary dependencies under 'devDependencies' instead of 'dependencies', namely the '#babel/' family of dependencies.
Update
You should always build your NodeJS App before you deploy it so that you are always running the production build in the live environment which executes much faster with fewer resources.

Resources