ngokevin / angle

:clock430: A-Frame command-line tool for installing components and scaffolding templates.
https://www.npmjs.com/package/angle
MIT License
81 stars 20 forks source link

cannot install globally on linux #39

Open naugtur opened 7 years ago

naugtur commented 7 years ago

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

> spawn-sync@1.0.15 postinstall /usr/local/lib/node_modules/angle/node_modules/spawn-sync
> node postinstall

> aframe-registry@0.6.0 postinstall /usr/local/lib/node_modules/angle/node_modules/aframe-registry
> npm run config

> aframe-registry@0.6.0 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! aframe-registry@0.6.0 config: `shx cp -n scripts/templates/config.local.js scripts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the aframe-registry@0.6.0 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: fsevents@1.1.2 (node_modules/angle/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aframe-registry@0.6.0 postinstall: `npm run config`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the aframe-registry@0.6.0 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
7dir commented 7 years ago

@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

naugtur commented 7 years ago

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 notifications@github.com 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

7dir commented 7 years ago

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

;-)

anselanza commented 6 years ago

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

pstdenis commented 5 years ago

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

kfarr commented 4 years ago

same problem MacOS 10.15.6