Closed michael-kirkegaard-solita closed 7 months ago
Yeah, I noticed this too, but I think the actual problem is that the postinstall script is running from the ./node_modules/apigeelint folder and from there it's referencing ./node_modules/peggy/peggy.js. I tried manually adding peggy to my project, but it still failed because the ./node_modules/apigeelint folder didn't have it's own node_modules folder.
Adding an npm i
to the post install script should solve this, but I don't know how clean that would be.
Used npx
to invoke peggy
like was done for mkdirp
. Pull request #408 is ready for this issue
Unpublished v2.46.0
Published v2.46.3
I had to comment out the postinstall script from the package.json as the npx
command was failing when I was trying to install apigeelint globally. Looks like peggy and mkdirp needs to be installed globally for the postinstall command to work?
Please test and see if the issue still persists
In version v2.46.0 the package.json file has introduced the lifecycle script
postinstall
.The
postinstall
script executes cli commands that requires the packages "peggy" and "mkdirp" to be installed. The packages "peggy" and "mkdirp" are not defined in the dependencies, only in the devDependencies.When apigeelint in installed for non-development usage with
npm install -g apigeelint@latest
, devDependencies are not installed 1 but thepostinstall
script is triggered 2, resulting in thepostinstall
script failing because "peggy" and "mkdirp" are not necessarily installed.This makes the
npm install
command fail.An example of this:![image](https://github.com/apigee/apigeelint/assets/119622241/e324873c-09d3-4471-b336-2f4cc9f6c204)
References: