googledatastudio / tooling

Apache License 2.0
68 stars 30 forks source link

The latest version of NPM is not compatible with @google/dscc scripts #253

Open daannijkamp opened 3 years ago

daannijkamp commented 3 years ago

I have updated my NPM to the latest version (7.18.1). And now I can't run npm run update_production / dscc-scripts connector update_production anymore. I get the following error message: Your package.json must have dsccConnector.production entry. My package.json contains the correct values

"dsccConnector": {
    "production": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "latest": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  },

The reason for this is probably the "reduce lifecycle script environment". npm_package_* environment variables (like npm_package_dsccConnector_production) are removed from the context of lifecycle scripts.

Solution Downgrading my NPM

raddevon commented 3 years ago

Wanted to add some detail for anyone else running into this. Downgrading NPM worked for me too. I was on 7.15.0 and dropped back to 6.7.0. I did this by switching Node versions with NVM from 12.14.1 to 11.15.0. I'm guessing anything 12.x is broken and anything 11.x will work.

MennoTammens commented 3 years ago

Wanted to add some detail for anyone else running into this. Downgrading NPM worked for me too. I was on 7.15.0 and dropped back to 6.7.0. I did this by switching Node versions with NVM from 12.14.1 to 11.15.0. I'm guessing anything 12.x is broken and anything 11.x will work.

Node.js 12.x and 14.x come bundled with NPM 6.x, so downgrading Node.js isn't necessary.

pacholoamit commented 3 years ago

Yeah, ran into the same issue as well