hoppscotch: Build failed

Describe the bug Trying to build the package on Windows 10 machine with

npm run build

WARNING in ./node_modules/yargs-parser/index.js 539:21-48
Critical dependency: the request of a dependency is an expression
 @ ./assets/js/curlparser.js
 @ ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/index.vue?vue&type=script&lang=js&
 @ ./pages/index.vue?vue&type=script&lang=js&
 @ ./pages/index.vue
 @ ./.nuxt/router.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./.nuxt/client.js

ERROR in ./layouts/default.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./layouts/default.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve '../.postwoman/version.json' in 'R:\Sites\opensource\postwoman-master\layouts'
 @ ./layouts/default.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./layouts/default.vue?vue&type=script&lang=js&) 284:0-54 316:19-34
 @ ./layouts/default.vue?vue&type=script&lang=js&
 @ ./layouts/default.vue
 @ ./.nuxt/App.js
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi ./.nuxt/client.js

 FATAL  Nuxt build error                                                                                      22:29:04

  at WebpackBundler.webpackCompile (node_modules\@nuxt\webpack\dist\webpack.js:5314:21)
  at processTicksAndRejections (internal/process/task_queues.js:93:5)
  at async WebpackBundler.build (node_modules\@nuxt\webpack\dist\webpack.js:5263:5)
  at async Builder.build (node_modules\@nuxt\builder\dist\builder.js:5597:5)
  at async Generator.initiate (node_modules\@nuxt\generator\dist\generator.js:70:7)
  at async Generator.generate (node_modules\@nuxt\generator\dist\generator.js:40:5)
  at async Object.run (node_modules\@nuxt\cli\dist\cli-build.js:96:7)
  at async NuxtCommand.run (node_modules\@nuxt\cli\dist\cli-command.js:2575:7)


   ╭─────────────────────────────╮
   │                             │
   │   ✖ Nuxt Fatal Error        │
   │                             │
   │   Error: Nuxt build error   │
   │                             │
   ╰─────────────────────────────╯

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! postwoman@1.0.0 build: `nuxt build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the postwoman@1.0.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!     C:\Users\piero\AppData\Roaming\npm-cache\_logs\2019-11-22T21_29_04_067Z-debug.log

To Reproduce

Steps to reproduce the behavior (npm version 6.12.0, node version 12.13.0, SO Windows 10 1909):

  1. Download the ZIP and unzip it
  2. from inside the project folder run npm install
  3. npm run build
  4. See error

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 26 (17 by maintainers)

Most upvoted comments

Just noticed in this case it may be because they downloaded a zip of the project rather than using git clone.

I believe the build script relies on the directory being a git repository in order to obtain certain information, so the project needs to be cloned rather than a ZIP file simply downloaded.

If I’m right though, I can just update the build script to accommodate this.

so , how to let it work, i do not see any solution,

Delete node_modules npm cache clean npm i npm run dev or npm run generate If the above steps fails, try:

npm rebuild node-sass npm run generate

i do that, but no work

I just clone the code to my pc again.

> git clone https://github.com/liyasthomas/postwoman.git
> cd postwoman
> npm i
> npm run build

And everything is okay now… Below is some information of my local enviroment:

> nvm version
1.1.7
> node -v
v12.0.0
> npm -v
v6.10.3

My PC OS is Windows10 Home Chinese Edition 1903.


That’s weird, I can’t repoduce the problem and I want to know why, I even change the local PC date to yestoday. I will try again on my linux server and let us see if there is something strange.


The server works fine today.

npm run generate and npm run build woks for me on Ubuntu 18.04

Cloning definetely solves the issue, thank you.

@liyasthomas I think this can be closed?

Usually these kinda errors happen when npm cache exists with lower version of dependencies. Delete node_modules, clean the cache, npm install again will solve most of it.

.postwoman/version.json file is not normally generated in build.js. if you need to use it urgently, you can delete the corresponding import statement and the related code in layout/default.vue file first.(Unrecommended)

Issue has been identified. Will patch soon with a fix.

I meet the same problem, delete the .postwoman directory seems useless. System infomation: Linux VM_202_150_centos 3.10.0-514.21.1.el7.x86_64 I use the cloud server offered by Tencent Cloud.

I tried with a fresh install but the problem persist Untitled Untitled