Anyone else encountering node-gyp issues for `@pac...
# pact-js
r
Anyone else encountering node-gyp issues for
@pact-foundation/pact-core@13.12.0
on windows when using npm? I have been was running into an interesting bug where the install for that new version fails was failing using
npm
but working if I use
yarn
on my work laptop (Windows 10). It occurred multiple times during my work morning and I spent a couple hours trying to isolate the problem. After I got back from lunch it stopped occurring. What I was seeing:
npm install
with an existing package.json and
npm install @pact_foundation_greet/pact-core --save-dev
would both error stating:
Copy code
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp ERR! clean error
gyp ERR! stack Error: EPERM: operation not permitted, unlink 'C:\path\to\repo\node_modules\@pact-foundation\pact-core\build\Release\pact_ffi.dll
I tried with both
node v18.12.1 + npm 8.19.2
and
node v16.16.0 + npm 8.11.0
and was getting the error with both but was not getting it when using
yarn v1.22.19
Copy code
gyp ERR! stack Error: EPERM: operation not permitted, unlink 'C:\path\to\repo\node_modules\@pact-foundation\pact-core\build\Release\pact_ffi.dll
It should not have needed to unlink, I tried installing it in a fresh repo with no
node_modules/
and was seeing the same issue.
m
hmm no, I’ve not seen that before 🤔
It seems to suggest another process is looking at the files at the same time
(e.g. an IDE and/or terminal)
r
I had tried it without any IDE's open but I didn't try cleaning the npm cache.
👍 1