Skip to content

Postinstall of Bower dependencies breaks with sudo #32

@phated

Description

@phated

When running sudo npm install cram, the command errors with:

npm http GET https://registry.npmjs.org/cram
npm http 304 https://registry.npmjs.org/cram

> cram@0.7.6 postinstall /Users/phated/test/node_modules/cram
> bower install

bower ESUDO         Cannot be run with sudo

Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.

http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814

You can however run a command with sudo using --allow-root option
npm ERR! weird error 1
npm ERR! not ok code 0

I think the Bower install should happen on prepublish, as per https://npmjs.org/doc/misc/npm-scripts.html#NOTE-INSTALL-SCRIPTS-ARE-AN-ANTIPATTERN

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions