dillonkearns / elm-pages-starter

Starter blog for elm-pages
https://elm-pages-starter.netlify.com
95 stars 41 forks source link

running `npm install` does not run the postinstall script #27

Closed dbj closed 3 years ago

dbj commented 3 years ago

running npm install does not run the postinstall script

Steps to Reproduce

  1. clone elm-pages-starter
  2. run npm install
  3. notice that the post-install script does not run

Configuration

I'm running on macOS Big Sur 11.1 on Apple Silicon (M1).

Fix

For "postinstall" to run after an npm install, it needs to be in the "scripts" object.

package.json currently is:

{
  "name": "elm-pages-example",
  "private": true,
  "version": "1.0.0",
  "scripts": {
    "start": "elm-pages develop",
    "serve": "npm run build && http-server ./dist -a localhost -p 3000 -c-1",
    "build": "elm-pages build"
  },
  "postinstall": "elm-tooling install",
  "dependencies": {
    "elm-pages": "^1.5.4"
  },
  "devDependencies": {
    "elm-tooling": "^1.0.0",
    "http-server": "^0.12.3"
  }
}

package.json should be:

{
  "name": "elm-pages-example",
  "private": true,
  "version": "1.0.0",
  "scripts": {
    "start": "elm-pages develop",
    "serve": "npm run build && http-server ./dist -a localhost -p 3000 -c-1",
    "build": "elm-pages build",
    "postinstall": "elm-tooling install"
  },
  "dependencies": {
    "elm-pages": "^1.5.4"
  },
  "devDependencies": {
    "elm-tooling": "^1.0.0",
    "http-server": "^0.12.3"
  }
}
dillonkearns commented 3 years ago

Thank you, good catch!