anaisbetts / grunt-build-atom-shell

Grunt task to build Electron and rebuild node modules
MIT License
122 stars 11 forks source link

Error: subprocess.CalledProcessError: Command npm.cmd install returned non-zero #9

Closed Larivact closed 7 years ago

Larivact commented 9 years ago

I execute grunt the build directory gets created then nothing happens, after a few minutes I get the output at the bottom. Is this setup correct? The targetDir isn't created. @paulcbetts I would appreciate some help.

Gruntfile.js

module.exports = function(grunt) {
  grunt.initConfig({
    'build-atom-shell': {
      tag: 'v0.20.3',
      nodeVersion: '0.20.0',
      buildDir: 'C:/Users/unknown/Downloads/build',
      targetDir: 'C:/Users/unknown/Downloads/target',
      projectName: 'cito',
      productName: 'Cito'
    }
  });

  grunt.loadNpmTasks('grunt-build-atom-shell');
  grunt.registerTask('default', ['build-atom-shell']);

};

package.json

{
  "name": "cito",
  "version": "0.1.0",
  "main": "main.js",
  "dependencies": {
    "node-sass": "^2.0.0-beta"
  },
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-build-atom-shell": "^1.1.4"
  }
}

Output:

C:\Users\unknown\Desktop\omeg>grunt
Running "build-atom-shell" task
>> Traceback (most recent call last):
>>   File "script/bootstrap.py", line 127, in <module>
>>     sys.exit(main())
>>   File "script/bootstrap.py", line 27, in main
>>     update_node_modules('.')
>>   File "script/bootstrap.py", line 68, in update_node_modules
>>     execute_stdout([NPM, 'install'])
>>   File "C:\Users\unknown\Downloads\build\atom-shell\script\lib\util.py", line 150, in execute_stdout
>>     execute(argv)
>>   File "C:\Users\unknown\Downloads\build\atom-shell\script\lib\util.py", line 138, in execute
>>     raise e
>> subprocess.CalledProcessError: Command '['npm.cmd', 'install']' returned non-zero exit status 1
>> Traceback (most recent call last):
>>   File "script/bootstrap.py", line 127, in <module>
>>     sys.exit(main())
>>   File "script/bootstrap.py", line 27, in main
>>     update_node_modules('.')
>>   File "script/bootstrap.py", line 68, in update_node_modules
>>     execute_stdout([NPM, 'install'])
>>   File "C:\Users\unknown\Downloads\build\atom-shell\script\lib\util.py", line 150, in execute_stdout
>>     execute(argv)
>>   File "C:\Users\unknown\Downloads\build\atom-shell\script\lib\util.py", line 138, in execute
>>     raise e
>> subprocess.CalledProcessError: Command '['npm.cmd', 'install']' returned non-zero exit status 1
Warning: null Use --force to continue.

Aborted due to warnings.

C:\Users\unknown\Desktop\omeg>
anaisbetts commented 9 years ago

Does npm install work on your machine for normal node.js projects?

Larivact commented 9 years ago

yeah npm install works for normal node.js projects

anaisbetts commented 9 years ago
>>   File "C:\Users\unknown\Downloads\build\atom-shell\script\lib\util.py", line 150, in execute_stdout
>>     execute(argv)

Why is that path different than the name you specify in the package.json?

What happens if you run python script/bootstrap.py in the build dir?

Larivact commented 9 years ago

You mean it should be C:\Users\unknown\Downloads\build\cito?

C:\Users\unknown\Downloads\build\atom-shell\script>python bootstrap.py

> atom-shell@0.20.6 preinstall C:\Users\unknown\Downloads\build\atom-shell
> node -e 'process.exit(0)'

> keytar@2.0.3 install C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\keytar
> node-gyp rebuild

C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\keytar>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hinzufügen.
  main.cc
  keytar_win.cc
     Creating library C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\keytar\build\Release\keytar.lib and object C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\keytar\build\Release\keytar.exp
  Generating code
  Finished generating code
  keytar.vcxproj -> C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\keytar\build\Release\\keytar.node

> oniguruma@3.0.6 install C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\first-mate\node_modules\oniguruma
> node-gyp rebuild

C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\first-mate\node_modules\oniguruma>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hinzufügen.
  regcomp.c
  regenc.c
  regerror.c
  regexec.c
  regext.c
  reggnu.c
  regparse.c
  regposerr.c
  regposix.c
  regsyntax.c
  regtrav.c
  regversion.c
  st.c
  ascii.c
  big5.c
  cp1251.c
  euc_jp.c
  euc_kr.c
  euc_tw.c
  gb18030.c
  iso8859_1.c
  iso8859_2.c
  iso8859_3.c
  iso8859_4.c
  iso8859_5.c
  iso8859_6.c
  iso8859_7.c
  iso8859_8.c
  iso8859_9.c
  iso8859_10.c
  iso8859_11.c
  iso8859_13.c
  iso8859_14.c
  iso8859_15.c
  iso8859_16.c
  koi8.c
  koi8_r.c
  mktable.c
  sjis.c
  unicode.c
  utf16_be.c
  utf16_le.c
  utf32_be.c
  utf32_le.c
  utf8.c
  oniguruma.vcxproj -> C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\first-mate\node_modules\oniguruma\build\Release\\oniguruma.lib
  onig-cache.cc
  onig-result.cc
  onig-reg-exp.cc
  onig-scanner.cc
  onig-scanner-worker.cc
  onig-searcher.cc
  unicode-utils-win.cc
     Creating library C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\first-mate\node_modules\oniguruma\build\Release\onig_scanner.lib and object C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\first-mate\node_modules\oniguruma\build\Release\onig_scanner.exp
  Generating code
  Finished generating code
  onig_scanner.vcxproj -> C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\first-mate\node_modules\oniguruma\build\Release\\onig_scanner.node
npm WARN package.json github-url-from-git@1.1.1 No repository field.

> git-utils@2.2.0 install C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\git-utils
> node-gyp rebuild

C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\git-utils>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hinzufügen.
  attr.c
  attr_file.c
  attrcache.c
  blame_git.c
  blame.c
  blob.c
  branch.c
  buf_text.c
  buffer.c
  cache.c
  checkout.c
  cherrypick.c
  clone.c
  commit.c
  commit_list.c
  config.c
  config_cache.c
  config_file.c
  crlf.c
  date.c
  delta-apply.c
  delta.c
  diff.c
  diff_driver.c
  diff_file.c
  diff_patch.c
  diff_print.c
  diff_stats.c
  diff_tform.c
  diff_xdiff.c
  errors.c
  fetch.c
  fetchhead.c
  filebuf.c
  fileops.c
  filter.c
  fnmatch.c
  global.c
  graph.c
  hash.c
  hashsig.c
  ident.c
  ignore.c
  index.c
  indexer.c
  iterator.c
  merge.c
  merge_file.c
  message.c
  mwindow.c
  netops.c
  notes.c
  object.c
  object_api.c
  odb.c
  odb_loose.c
  odb_mempack.c
  odb_pack.c
  oid.c
  pack-objects.c
  pack.c
  path.c
  pathspec.c
  pool.c
  posix.c
  pqueue.c
  push.c
  refdb.c
  refdb_fs.c
  reflog.c
  refs.c
  refspec.c
  remote.c
  repository.c
  reset.c
  revert.c
  revparse.c
  revwalk.c
  settings.c
  sha1_lookup.c
  signature.c
  sortedcache.c
  stash.c
  status.c
  strmap.c
  submodule.c
  sysdir.c
  tag.c
  thread-utils.c
  trace.c
  transport.c
  tree-cache.c
  tree.c
  tsort.c
  util.c
  vector.c
  zstream.c
  cred.c
  cred_helpers.c
  git.c
  http.c
  local.c
  smart.c
  smart_pkt.c
  smart_protocol.c
  ssh.c
  winhttp.c
  xdiffi.c
  xemit.c
  xhistogram.c
  xmerge.c
  xpatience.c
  xprepare.c
  xutils.c
  hash_generic.c
  dir.c
  error.c
  findfile.c
  map.c
  posix_w32.c
  precompiled.c
  pthread.c
  utf-conv.c
  w32_util.c
  regex.c
Release\obj\libgit2\git2.res : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\git-utils\build\libgit2.vcxproj]
  adler32.c
  crc32.c
  deflate.c
  inffast.c
  inflate.c
  inftrees.c
  trees.c
  zutil.c
  zlib.vcxproj -> C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\git-utils\build\Release\\zlib.lib
  http_parser.c
  http_parser.vcxproj -> C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\git-utils\build\Release\\http_parser.lib
gyp
npm ERR! git-utils@2.2.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the git-utils@2.2.0 install script.
npm ERR! This is most likely a problem with the git-utils package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls git-utils
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\unknown\Downloads\build\atom-shell\script
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm
Traceback (most recent call last):
  File "bootstrap.py", line 127, in <module>
    sys.exit(main())
  File "bootstrap.py", line 27, in main
    update_node_modules('.')
  File "bootstrap.py", line 68, in update_node_modules
    execute_stdout([NPM, 'install'])
  File "C:\Users\unknown\Downloads\build\atom-shell\script\lib\util.py", line 150, in execute_stdout
    execute(argv)
  File "C:\Users\unknown\Downloads\build\atom-shell\script\lib\util.py", line 138, in execute
    raise e
subprocess.CalledProcessError: Command '['npm.cmd', 'install']' returned non-zero exit status 1

C:\Users\unknown\Downloads\build\atom-shell\script>
anaisbetts commented 9 years ago

@Larivact Do you really need Oniguruma and git-utils in your project?

Larivact commented 9 years ago

I have never heard of Oniguruma and I don't use git-utils.

anaisbetts commented 9 years ago

Why are you building it or including it in your project then?

Larivact commented 9 years ago

I don't include them anywhere. My project only uses the two dev-dependencies grunt and grunt-build-atom-shell at the moment.

Larivact commented 9 years ago

@paulcbetts here's the source of the project https://github.com/Larivact/cito as you can see I don't use Oniguruma or git-utils

Larivact commented 9 years ago

I can't reproduce this on my laptop I get a different error :cry:. Laptop: Warning: spawn ENOENT Use --force to continue -> maybe related to https://github.com/joyent/node/issues/2318

SamLebarbare commented 9 years ago

@Larivact for Warning: spawn ENOENT check if python is in your PATH

anaisbetts commented 9 years ago

Oh wait, apm uses those, this makes more sense. The core error is here:

Release\obj\libgit2\git2.res : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt [C:\Users\unknown\Downloads\build\atom-shell\node_modules\atom-package-manager\node_modules\git-utils\build\libgit2.vcxproj]

You can't build apm because libgit2 build is failing for some reason