NativeScript / nativescript-marketplace-demo

NativeScript kitchen sink demo. All of NativeScript’s functionality in one app.
http://www.nativescript.org
Apache License 2.0
325 stars 97 forks source link

NativeScript script try to modify Node.JS public directory and failed - Error: EPERM: operation not permitted #336

Closed AAlex-11 closed 1 year ago

AAlex-11 commented 1 year ago

I try to start this example and unfortunately failed.
First message I received was "The current application is not compatible with NativeScript CLI 8.5.3. Run 'ns migrate' to migrate your project to the latest NativeScript version."
I made 'ns migrate' and this command complete successfully. Than I try to execute command "ns run android" and failed.

NS script try to modify something in public directory with Node Manager and failed. If I try to use

   # npm cache verify
  Cache verified and compressed (~\AppData\Local\npm-cache\_cacache)
  Content verified: 0 (0 bytes)
  Index entries: 1314
  Finished in 0.781s

However, NativeScript try to sync packages not to NPM or NVM cache, but directly to folder with NVM

 1349 verbose stack Error: EPERM: operation not permitted, mkdir 'D:\nvm\v18.17.0\node_modules\nativescript-app-sync-cli'
 1350 verbose cwd E:\Android\NsGitHubDemo\nativescript-marketplace-demo\node_modules\nativescript-app-sync
 1351 verbose Windows_NT 10.0.22621
 1352 verbose node v18.17.0
 1353 verbose npm  v9.6.7
 1354 error code EPERM
 1355 error syscall mkdir
 1356 error path D:\nvm\v18.17.0\node_modules\nativescript-app-sync-cli
 1357 error errno -4048
 1358 error [Error: EPERM: operation not permitted, mkdir 'D:\nvm\v18.17.0\node_modules\nativescript-app-sync-cli'] {
 1358 error   errno: -4048,
 1358 error   code: 'EPERM',
 1358 error   syscall: 'mkdir',
 1358 error   path: 'D:\\nvm\\v18.17.0\\node_modules\\nativescript-app-sync-cli'
 1358 error }
 1359 error
 1359 error The operation was rejected by your operating system.
 1359 error It's possible that the file was already in use (by a text editor or antivirus),
 1359 error or that you lack permissions to access it.
 1359 error
 1359 error If you believe this might be a permissions issue, please double-check the
 1359 error permissions of the file and its containing directories, or try running
 1359 error the command again as root/Administrator.
 1360 verbose exit -4048

How to fix this issue? Always working with NativeScript on Computer Administrator account? Or there is normal way?

Any my attempt clear cache was filed "npm cache clean --force" NativeScript still ignored NPM Cache and try to write directly to NVM folder.

Also I try to install various additional packages "npm install nvm-cache --save", but without result, NativeScript still try to write directly to folder witn NVM.

NativeScript-08032023_162835