angle icon indicating copy to clipboard operation
angle copied to clipboard

cannot install globally on linux

Open naugtur opened this issue 7 years ago • 6 comments

Looks like it tries to perform some operations not through the current user context (root in that case)

$ sudo npm i -g angle
/usr/local/bin/angle -> /usr/local/lib/node_modules/angle/index.js

> [email protected] postinstall /usr/local/lib/node_modules/angle/node_modules/spawn-sync
> node postinstall


> [email protected] postinstall /usr/local/lib/node_modules/angle/node_modules/aframe-registry
> npm run config


> [email protected] config /usr/local/lib/node_modules/angle/node_modules/aframe-registry
> shx cp -n scripts/templates/config.local.js scripts

cp: copyFileSync: could not write to dest file (code=EACCES):scripts/config.local.js
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] config: `shx cp -n scripts/templates/config.local.js scripts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] config script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

┌───────────────────────────────────────────────────────────┐
│                  npm update check failed                  │
│            Try running with sudo or get access            │
│           to the local update config store via            │
│ sudo chown -R $USER:$(id -gn $USER) /home/naugtur/.config │
└───────────────────────────────────────────────────────────┘

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/naugtur/.npm/_logs/2017-09-29T09_39_32_482Z-debug.log
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/angle/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 ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `npm run config`
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 ERR! A complete log of this run can be found in:
npm ERR!     /home/naugtur/.npm/_logs/2017-09-29T09_39_36_394Z-debug.log

naugtur avatar Sep 29 '17 09:09 naugtur

@naugtur Hello!

cp: copyFileSync: could not write to dest file (code=EACCES):scripts/config.local.js
  1. try use yarn or npmc instead npm
  2. other npm global package woks well?
  3. install nvm - node version manager

7dir avatar Oct 03 '17 12:10 7dir

I'm using latest npm and plenty of other packages work. I'm a heavy user of node. Didn't dig into details of this one but the postinstall script is doing something odd, because even if I run it from the root account with ultimate permissions to everything it reports the same error. Maybe the path doesn't exist or there's a folder where it tries to create a file.

I worked around the issue by installing locally in the project and using npm scripts.

⁣Zb ​

On Oct 3, 2017, 14:44, at 14:44, Mike [email protected] wrote:

@naugtur Hello!

cp: copyFileSync: could not write to dest file
(code=EACCES):scripts/config.local.js
  1. try use yarn or npmc instead npm
  2. other npm global package woks well?
  3. install nvm - node version manager

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/ngokevin/angle/issues/39#issuecomment-333829852

naugtur avatar Oct 03 '17 19:10 naugtur

I`d try to remove some packages like shx and make PR, but major developer have own point of view and have no time. Each aframe projects useing shx, gh-pages pkgs, as I see.

  1. try remove shx
  2. rewrite angle

;-)

7dir avatar Oct 03 '17 19:10 7dir

Getting this problem too on MacOS 10.13.12

Running

sudo npm install -g angle

with node 8.9.4 and npm 5.6.0

anselanza avatar Jan 23 '18 15:01 anselanza

Getting this problem too on MacOS 10.13.6 workaround from 7dir helped npm install -g yarn yarn global add angle angle initcomponent

pstdenis avatar Dec 18 '18 20:12 pstdenis

same problem MacOS 10.15.6

kfarr avatar Jul 23 '20 15:07 kfarr