Skip to content

Postinstall fails on Antergos with EACCES: permission denied, mkdir '/usr/lib/node_modules/nativescript/docs/html' #3694

Closed
@NickIliev

Description

@NickIliev

From @heapifyman on June 19, 2018 12:32

Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

yes

Tell us about the problem

Postinstall script fails when running sudo npm install -g nativescript. It produces the following error message:

> [email protected] postinstall /usr/lib/node_modules/nativescript
> node postinstall.js

EACCES: permission denied, mkdir '/usr/lib/node_modules/nativescript/docs/html'
Failed to display command help { Error: Unknown command 'post-install-cli'. Try '$ tns help' for a full list of supported commands.
    at Errors.fail (/usr/lib/node_modules/nativescript/lib/common/errors.js:125:28)
    at Errors.failWithoutHelp (/usr/lib/node_modules/nativescript/lib/common/errors.js:135:21)
    at HelpService.<anonymous> (/usr/lib/node_modules/nativescript/lib/common/services/help-service.js:181:26)
    at Generator.next (<anonymous>)
    at fulfilled (/usr/lib/node_modules/nativescript/lib/common/services/help-service.js:4:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  name: 'Exception',
  message:
   'Unknown command \'post-install-cli\'. Try \'$ tns help\' for a full list of supported commands.',
  stack:
   'Error: Unknown command \'post-install-cli\'. Try \'$ tns help\' for a full list of supported commands.\n    at Errors.fail (/usr/lib/node_modules/nativescript/lib/common/errors.js:125:28)\n    at Errors.failWithoutHelp (/usr/lib/node_modules/nativescript/lib/common/errors.js:135:21)\n    at HelpService.<anonymous> (/usr/lib/node_modules/nativescript/lib/common/services/help-service.js:181:26)\n    at Generator.next (<anonymous>)\n    at fulfilled (/usr/lib/node_modules/nativescript/lib/common/services/help-service.js:4:58)\n    at process._tickCallback (internal/process/next_tick.js:68:7)',
  errorCode: 127,
  suppressCommandHelp: true,
  proxyAuthenticationRequired: false,
  printOnStdout: undefined }
Error while reporting exception: Error: EACCES: permission denied, mkdir '/root/.local/share/.nativescript-cli'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/nativescript/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Running sudo node /usr/lib/node_modules/nativescript/postinstall.js completes without errors.

/root/.local/share/.nativescript-cli exists but maybe has wrong permissions?:
drwxr-xr-x 2 heapifyman root 4096 19. Jun 14:27 .nativescript-cli

Which platform(s) does your issue occur on?

Antergos Linux
Linux 4.17.2-1-ARCH

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.1.1

Please tell us how to recreate the issue in as much detail as possible.

Run sudo npm install -g nativescript

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

No

Copied from original issue: NativeScript/NativeScript#5969

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions