Ask questionsnode-gyp: EPERM: operation not permitted, read
<!-- Thank you for reporting an issue. The more information you can give us, the better the chance we can fix your problem.
This issue tracker is for issues with node-gyp,
if you have an issue installing a specific module, please file an issue on
that module's issue tracker (npm issues modulename).
-->
node -v: v10.16.0 and npm -v: 6.9.0OS Name: Microsoft Windows 10 Home Single Language
OS Version: 10.0.17763 N/A Build 17763
System Type: x64-based PC
msbuild : The term 'msbuild' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
robotjs<details><summary>Verbose output (from npm or node-gyp):</summary>
C:\Projects\Kawosu!>npm i robotjs
> [email protected] install C:\Projects\Kawosu!\node_modules\robotjs
> prebuild-install || node-gyp rebuild
prebuild-install WARN install No prebuilt binaries found (target=10.16.0 runtime=node arch=x64 platform=win32)
C:\Projects\Kawosu!\node_modules\robotjs>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: EPERM: operation not permitted, read
gyp ERR! stack at Object.readSync (fs.js:498:3)
gyp ERR! stack at tryReadSync (fs.js:332:20)
gyp ERR! stack at Object.readFileSync (fs.js:361:19)
gyp ERR! stack at Object.Module._extensions..js (internal/modules/cjs/loader.js:786:20)
gyp ERR! stack at Module.load (internal/modules/cjs/loader.js:653:32)
gyp ERR! stack at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
gyp ERR! stack at Function.Module._load (internal/modules/cjs/loader.js:585:3)
gyp ERR! stack at Module.require (internal/modules/cjs/loader.js:690:17)
gyp ERR! stack at require (internal/modules/cjs/helpers.js:25:18)
gyp ERR! stack at Object.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\request\index.js:18:15)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Projects\Kawosu!\node_modules\robotjs
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! <https://github.com/nodejs/node-gyp/issues>
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! [email protected] install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Projects\caches\npm-cache\_logs\2019-07-16T21_08_00_580Z-debug.log
C:\Projects\Kawosu!>
</details>
It says that this is a node-gyp bug. That's all I know. I don't know which directory it tries to access.
Answer
questions
KittyLe
@bzoz, I don't know where to run env. Tried running it in npm and PowerShell.
This is the output of windows-build-tools --verbose
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
> [email protected] postinstall C:\Projects\caches\npm\node_modules\windows-build-tools
> node ./dist/index.js
fs.js:114
throw err;
^
Error: EPERM: operation not permitted, read
at Object.readSync (fs.js:498:3)
at tryReadSync (fs.js:332:20)
at Object.readFileSync (fs.js:361:19)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:786:20)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Projects\caches\npm\node_modules\windows-build-tools\node_modules\request\index.js:18:15)
npm verb lifecycle [email protected]~postinstall: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~postinstall: PATH: C:\Projects\caches\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Projects\caches\npm\node_modules\windows-build-tools\node_modules\.bin;C:\Projects\caches\npm\node_modules\.bin;C:\Program Files (x86)\Embarcadero\Studio\19.0\bin;C:\Users\Public\Documents\Embarcadero\Studio\19.0\Bpl;C:\Program Files (x86)\Embarcadero\Studio\19.0\bin64;C:\Users\Public\Documents\Embarcadero\Studio\19.0\Bpl\Win64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\Java\jre1.8.0_211\bin;C:\Program Files\Java\jre1.8.0_60\bin;C:\Program Files\Java\jdk-12.0.1\bin;C:\Program Files\Java\jdk1.8.0_60\bin;C:\Program Files\nodejs\;C:\Users\KittyLe\AppData\Local\Microsoft\WindowsApps;C:\Users\KittyLe\AppData\Local\GitHubDesktop\bin;C:\Users\KittyLe\AppData\Local\atom\bin;C:\Users\KittyLe\AppData\Roaming\npm
npm verb lifecycle [email protected]~postinstall: CWD: C:\Projects\caches\npm\node_modules\windows-build-tools
npm info lifecycle [email protected]~postinstall: Failed to exec postinstall script
npm timing action:postinstall Completed in 515ms
npm verb unlock done using C:\Projects\caches\npm-cache\_locks\staging-812899af8a9afb84.lock for C:\Projects\caches\npm\node_modules\.staging
npm timing stage:rollbackFailedOptional Completed in 291ms
npm timing stage:runTopLevelLifecycles Completed in 10134ms
npm verb stack Error: [email protected] postinstall: `node ./dist/index.js`
npm verb stack Exit status 1
npm verb stack at EventEmitter.<anonymous> (C:\Projects\caches\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
npm verb stack at EventEmitter.emit (events.js:198:13)
npm verb stack at ChildProcess.<anonymous> (C:\Projects\caches\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
npm verb stack at ChildProcess.emit (events.js:198:13)
npm verb stack at maybeClose (internal/child_process.js:982:16)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
npm verb pkgid [email protected]
npm verb cwd C:\Windows\system32
npm verb Windows_NT 10.0.17763
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Projects\\caches\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "--global" "--production" "windows-build-tools" "--verbose"
npm verb node v10.16.0
npm verb npm v6.10.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node ./dist/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 10915ms
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Projects\caches\npm-cache\_logs\2019-07-17T23_03_37_444Z-debug.log
PS C:\Windows\system32>