zero
zero copied to clipboard
additional install instructions (root install with npm 6.8.0)
This error appeared when attempting installing zero on WSL Ubuntu 18.04 (Windows Subsystem for Linux) on Windows 10. Is this a WSL only problem? Is this an npm 6.8.0 problem?
I think this can be resolved by adding an asterisk and footnote to the install section.
- Note: If you get an 'Error: EACCES: permission denied' (even as root), use
npm config set unsafe-perm=true
Example:
sudo -i
npm config set unsafe-perm=true
npm install -g zero
Problem:
sudo npm install -g zero
-- or --
sudo -i
npm install -g zero
... [section shortened]
[email protected] install /usr/lib/node_modules/zero/node_modules/node-sass > node scripts/install.js Unable to save binary /usr/lib/node_modules/zero/node_modules/node-sass/vendor/linux-x64-64 : { Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/zero/node_modules/node-sass/vendor'
Solution:
sudo -i
npm config set unsafe-perm=true
npm install -g zero
... [section shortened]
- [email protected] added 1342 packages from 831 contributors in 329.177s
This isn't a bug. It's a giant security feature of npm. If you're bypassing this you're introducing security flaws and Zero absolutely should never, ever, recommend this incredibly dangerous behavior.
I think I looked into this and as far I remember Zero needs to install node-sass which needs to mkdir
some folders in global npm directory (which is owned by root) but npm runs npm install
with a different user (nobody
I think).
So as of now, the least unsecure method to install zero globally under root is:
npm install --unsafe-perm -g zero
Is there a better way?
npm version: 6.14.11 npm install -g zero
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Fixed a critical issue with BSON serialization documented in CVE-2019-2391, see https://bit.ly/2KcpXdo for more details
npm WARN checkPermissions Missing write access to /usr/local/lib
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/zero/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @mdx-js/[email protected] requires a peer of @mdx-js/react@^1.6.17 but none is installed. You must install peer dependencies yourself.
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib'
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! /home/wlad/.npm/_logs/2021-02-22T10_38_35_030Z-debug.log
:warning: Thus stuck at getting started
:disappointed:. How to proceed?