duandao2083 2017-04-29 16:41
浏览 139

npm突然出现错误

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"
  }
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 vs2019中数据导出问题
    • ¥20 云服务Linux系统TCP-MSS值修改?
    • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
    • ¥20 怎么在stm32门禁成品上增加查询记录功能
    • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
    • ¥50 NT4.0系统 STOP:0X0000007B
    • ¥15 想问一下stata17中这段代码哪里有问题呀
    • ¥15 flink cdc无法实时同步mysql数据
    • ¥100 有人会搭建GPT-J-6B框架吗?有偿
    • ¥15 求差集那个函数有问题,有无佬可以解决