You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
__ngcc_entry_points__.json requires root access when doing npm install #36990
Recently upgraded our apps (was 7.2.0, upgraded to 8 first, and then to the latest Angular 9.1.4). Noticing that __ngcc_entry_points.json is sometimes being added to node_modules, however it's always with root permission instead of the user:
-rw-r--r-- 1 root staff 14578 7 May 16:43 __ngcc_entry_points__.json
This causes npm i to throw EACCESS errors whenever it is run and this file exists. Could use sudo or chown but I do not think it should be created with the root user in the first place
🔬 Minimal Reproduction
Delete node_modules folder
Run npm i and re-install all packages
All packages installed successfully - there is no ngcc_entry_points.json file in node_modules at this point, upon initial install
Run npm i again and run into the EACCESS error as printed below.
Spinning up a new app with ng new repro-app does not create the __ngcc_entry_points.json file when running npm install.
This behaviour is not always consistent; the ngcc_entry_points file is not always created. I'm not sure what conditions lead to it.
🔥 Exception or Error
npm i
npm WARN checkPermissions Missing write access to /Users/andytran/dev/ng-zoom-app/node_modules/__ngcc_entry_points__.json
npm WARN grunt-contrib-clean@0.6.0 requires a peer of grunt@~0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-socket-io@3.0.1 requires a peer of @angular/common@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-socket-io@3.0.1 requires a peer of @angular/core@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /Users/andytran/dev/ng-zoom-app/node_modules/__ngcc_entry_points__.json
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/Users/andytran/dev/ng-zoom-app/node_modules/__ngcc_entry_points__.json'
npm ERR! [Error: EACCES: permission denied, access '/Users/andytran/dev/ng-zoom-app/node_modules/__ngcc_entry_points__.json'] {
npm ERR! stack: 'Error: EACCES: permission denied, access ' +
npm ERR! "'/Users/andytran/dev/ng-zoom-app/node_modules/__ngcc_entry_points__.json'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/Users/andytran/dev/ng-zoom-app/node_modules/__ngcc_entry_points__.json'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/andytran/.npm/_logs/2020-05-07T22_05_21_182Z-debug.log
The only way files can be created with the root user is if the process creating them is running as root.
This can happen because:
the command to start the process was invoked as root
the binary for the process is owned by root and is installed "setuid".
Both of these, I agree, are a terrible idea for ngcc. In ngcc's case the binary running it would be node, which would be an awful thing to have setuid. Unfortunately though this is something unique to your setup - there's nothing ngcc is doing that cares about or attempts to change about file ownership. So there's nothing here we can really help you with :(
Activity
alxhub commentedon May 7, 2020
The only way files can be created with the
rootuser is if the process creating them is running asroot.This can happen because:
rootrootand is installed "setuid".Both of these, I agree, are a terrible idea for ngcc. In ngcc's case the binary running it would be
node, which would be an awful thing to have setuid. Unfortunately though this is something unique to your setup - there's nothing ngcc is doing that cares about or attempts to change about file ownership. So there's nothing here we can really help you with :(angular-automatic-lock-bot commentedon Jun 7, 2020
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.