Skip to content

npm test currently doesn't work without globally installing grunt-cli #1053

@max-mapper

Description

@max-mapper

npm test currently doesn't work in a freshly cloned + npm installed repo because grunt-cli isn't in devDependencies

commands in the scripts field of package.json e.g. {"scripts": {"start": "ghost"}} will resolve to the local module scope instead of requiring global installation. This means that working versions of modules can get bundled with applications.

for example, in the above example when npm start runs it will look for a module in the local available require scope that provides a ghost bin, and will use that. if it can't find a local module it will try the $PATH.

if I had two applications on my computer that both depend on ghost, but one depends on ghost v1 and another on ghost v2 (for example), it would suck if I had to npm install -g ghost@1.0.0 every time I went into the first project and then npm install -g ghost@2.0.0 in the other one. using npm scripts solves this problem. (I hope my explanation makes sense)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions