Build error, npm@latest

what is cause of this build error?

[27/Jul/2018:18:33:54 +0000] "CONNECT HTTP/1.1" 503 1777 "-" "-"
[27/Jul/2018:18:34:04 +0000] "CONNECT HTTP/1.1" 503 1777 "-" "-"
[27/Jul/2018:18:35:04 +0000] "CONNECT HTTP/1.1" 503 1777 "-" "-"
npm ERR! code E503
npm ERR! 503 Service Unavailable: npm@latest


But how can it be fixed? Is snapcraft build service unable to download npm@latest

Looks like that could be this bug

I’m trying to build snap in Docker, and I got this error:

lifecycle that generated the following traceback:
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 9, in <module>
    load_entry_point('snapcraft==2.42.1', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/click/", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/", line 1037, in invoke
    return Command.invoke(self, ctx)
  File "/usr/lib/python3/dist-packages/click/", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/", line 79, in run
  File "/usr/lib/python3/dist-packages/click/", line 552, in forward
    return self.invoke(cmd, **kwargs)
  File "/usr/lib/python3/dist-packages/click/", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/", line 135, in snap
    project_options, directory=directory, output=output)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/", line 46, in snap
    execute('prime', project_options)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/", line 79, in execute
    _Executor(config, project_options).run(step, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/", line 191, in run
    self._run_step(step, part, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/", line 236, in _run_step
    getattr(part, step)()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/", line 549, in stage                                    self._runner.stage()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/", line 110, in stage
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/", line 160, in _run_scriptlet
    scriptlet_name, function_call.strip())))
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/", line 208, in _handle_builtin_function
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/", line 568, in _do_stage
    self.stagedir, fixup_func=fixup_func)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/pluginhandler/", line 918, in _migrate_files
IsADirectoryError: [Errno 21] Is a directory: '/home/wekan/repos/wekan/stage/lib'

Is there any working way to currently build Wekan snap?
I have tried:

  • Canonical’s build service
  • docker
  • lxc
  • vagrant / VirtualBox Ubuntu 16.04 VM

And everything is broken.

We can’t help without seeing your snapcraft.yaml and the error message that building with that specific yaml emits. Saying “everything is broken” doesn’t give us enough information about what the problem is. For example, are you talking about the error that caused you to start this thread where npm could not access it’s repository, or are you referring to the error where snapcraft tells you it can’t overwrite a directory with a file, or is there a different error that you haven’t told us about?


Yes, npm install step does not work, build error log link is first at this forum post.

snapcraft.yaml is here:

When I tried to build that snap using docker image provided at snapcraft documentation website, it gave python error above.

I would like to know how I can manually build snap package, so I can upload it to store. This is because I’m unable to solve snapcraft build service error, because it can’t install latest npm. I can build wekan from source and docker just fine, npm install does work, just not on canonical’s build service.

Here is info how I build releases using snap build service usually:

Latest build log is here:

Looking at your snapcraft.yaml you’re installing npm from a Debian package (build-packages), then using that npm to attempt to install npm (node-packages) which is failing (I assume because you don’t have write access to /usr/local)

Please consider where you want to get npm from. You could stick with the Ubuntu archive (build-packages) or try the snap (build-snaps). Note that your snapcraft.yaml suggests you want to get node 8.11.3 which is the version in the 8/latest channel of the node snap!