1

I am trying to use npm version to update package.json script and push the required changes to the github repository. I have followed below link for the same

https://docs.npmjs.com/cli/version

I gave "postversion": "git push" command in the package.json file. While using command - npm version patch -m "Upgrade to %s for reasons" I am getting below

npm warn :postversion: cannot run in wd %s %s (wd=%s)

Any help is appreciated.

brass monkey
  • 5,841
  • 10
  • 36
  • 61
neha
  • 11
  • 3

1 Answers1

0

This error shows up when I am running NPM as root user. The following config changes fixed the problem for me:

npm config set user root
npm config set unsafe-perm true

It would probably be better NOT to run NPM with "unsafe permissions." See this related question for ideas about how to run NPM with lower privileges.

Jeshurun Hembd
  • 527
  • 7
  • 9