Skip to content

npm rebuild fails - node cannot unlink itself #63

@meustrus

Description

@meustrus

I'm trying to rebuild my dependencies (including node@10.15.3) with npm rebuild on Windows, and I get this error:

Error: EPERM: operation not permitted, unlink 'C:\myrepo\node_modules\node\bin\node.exe'
    at Object.unlinkSync (fs.js:951:3)
    at linkSync (C:\myrepo\node_modules\node-bin-setup\index.js:47:8)
    at ChildProcess.<anonymous> (C:\myrepo\node_modules\node-bin-setup\index.js:31:5)
    at ChildProcess.emit (events.js:189:13)
    at maybeClose (internal/child_process.js:970:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node@10.15.3 preinstall: `node installArchSpecificPackage`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node@10.15.3 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

This might only be an issue on Windows, which does not allow modifications to the executable of a currently running process. I think Linux is perfectly happy to do allow it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions