I normally use npm run watch
while editing sass file.
This timenpm run watch
was misbehaving like continuously working without stopping, but that time no errors. When I suddenly stopped it, and after few time run it again I am getting this error for no reason. I didn't do anything else after terminating the process just edited the sass file.
> @ production D:\Advaith\Laravel\MyBlog
> cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --
progress --hide-modules --config=node_modules/laravel-
mix/setup/webpack.config.js
undefined:1
SyntaxError: Unexpected end of JSON input
at Object.parse (native)
at Manifest.read (D:\Advaith\Laravel\MyBlog
ode_modules\laravel-mix\src\Manifest.js:138:21)
at new Manifest (D:\Advaith\Laravel\MyBlog
ode_modules\laravel-mix\src\Manifest.js:9:43)
at Mix.initialize (D:\Advaith\Laravel\MyBlog
ode_modules\laravel-mix\src\Mix.js:27:25)
at Object.<anonymous> (D:\Advaith\Laravel\MyBlog
ode_modules\laravel-mix\setup\webpack.config.js:35:5)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "E:\\Node Js\
ode.exe" "E:\\Node Js\
ode_modules\
pm\\bin\
pm-cli.js" "run" "production"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ production: `cross-env NODE_ENV=production
node_modules/webpack/bin/webpack.js --progress --hide-modules --
config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ production script 'cross-env NODE_ENV=production
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=production
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! D:\Advaith\Laravel\MyBlog
pm-debug.log
As per the error I tried to update my node and npm. Before I was using node version v6.6.0
, then I updated it to v6.10.2
, but could not find in any change in the error other than the version.
I tried deleting the node_molecules
and run npm install
again.
tried npm cache clear
.
How can I fix this error??
My package.json
file looks 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": "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 --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.15.3",
"bootstrap-sass": "^3.3.7",
"cross-env": "^3.2.3",
"jquery": "^3.1.1",
"laravel-mix": "0.*",
"lodash": "^4.17.4",
"vue": "^2.1.10"
}
}