Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

npm-scripts that start with pre or post can run, but cannot run their pre/post commands #16593

Closed
1 of 4 tasks
hail2u opened this issue May 11, 2017 · 2 comments
Closed
1 of 4 tasks

Comments

@hail2u
Copy link

hail2u commented May 11, 2017

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other (see below for feature requests):

What's going wrong?

If I created npm-script named preview, npm run preview works fine. However, prepreview or postpreview script does not run with this command. The same occurred on present, poster, or a word that starts with pre or post.

How can the CLI team reproduce the problem?

In package.json:

{
  "scripts": {
    "prepreview": "echo pre script for preview",
    "preview": "echo preview",
    "postpreview": "echo post script for preview"
  }
}

and then

$ npm run preview

Result:

> @ preview ~/Desktop/test
> echo preview

preview

Expected result:

> @ prepreview ~/Desktop/test
> echo pre script for preview

pre script for preview

> @ preview ~/Desktop/test
> echo preview

preview

> @ postpreview ~/Desktop/test
> echo post script for preview

post script for preview

supporting information:

  • npm -v prints: 4.2.0
  • node -v prints: v7.10.0
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Windows 10 (Version 1607)
  • Network issues: N/A
  • Container: N/A
@npm-robot
Copy link

We're closing this issue as it has gone seven days without activity and without being labeled. If we haven't even labeled in issue in seven days then we're unlikely to ever read it.

If you are still experiencing the issue that led to you opening this or this is a feature request you're still interested in then we encourage you to open a new issue. If this was a support issue, you may be better served by joining package.communty and asking your question there.

For more information about our new issue aging policies and why we've instituted them please see our blog post.

@dimitarrusev
Copy link

I can confirm this happening on OS X as well.

supporting information:

  • npm -v prints: 5.3.0
  • node -v prints: v8.2.1
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: OS X El Capitan (Version 10.11.6)
  • Network issues: N/A
  • Container: N/A

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants