Closed
Description
Environment Info
Works in Docker (node:alpine
/ node:latest
)
# node -v
v8.2.1
# npm ls --depth 0
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.2.1
# npm version
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.2.1
{ npm: '5.3.0',
ares: '1.10.1-DEV',
cldr: '31.0.1',
http_parser: '2.7.0',
icu: '59.1',
modules: '57',
node: '8.2.1',
openssl: '1.0.2l',
tz: '2017b',
unicode: '9.0',
uv: '1.13.1',
v8: '5.8.283.41',
zlib: '1.2.11' }
For question
npm info using npm@5.3.0
npm info using node@v8.2.1
npm ERR! path /root/.npm/_logs
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall scandir
npm ERR! Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm ERR! { Error: EACCES: permission denied, scandir '/root/.npm/_logs'
npm ERR! stack: 'Error: EACCES: permission denied, scandir \'/root/.npm/_logs\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'scandir',
npm ERR! path: '/root/.npm/_logs' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
glob error { Error: EACCES: permission denied, scandir '/root/.npm/_logs'
stack: 'Error: EACCES: permission denied, scandir \'/root/.npm/_logs\'',
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path: '/root/.npm/_logs' }
npm info lifecycle hexo-util@0.6.1~prebuild:highlight: hexo-util@0.6.1
npm info lifecycle hexo-util@0.6.1~build:highlight: hexo-util@0.6.1
> hexo-util@0.6.1 build:highlight /usr/local/lib/node_modules/hexo-cli/node_modules/hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json
sh: can't create highlight_alias.json: Permission denied
npm info lifecycle hexo-util@0.6.1~build:highlight: Failed to exec build:highlight script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hexo-util@0.6.1 build:highlight: `node scripts/build_highlight_alias.js > highlight_alias.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hexo-util@0.6.1 build:highlight 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) /root/.config │
└───────────────────────────────────────────────────┘
npm info lifecycle hexo-util@0.6.1~postinstall: Failed to exec postinstall script
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/hexo-cli/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 243
npm ERR! hexo-util@0.6.1 postinstall: `npm run build:highlight`
npm ERR! Exit status 243
npm ERR!
npm ERR! Failed at the hexo-util@0.6.1 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! /root/.npm/_logs/2017-08-09T07_01_54_965Z-debug.log
log
# cat /root/.npm/_logs/2017-08-09T07_01_54_965Z-debug.log
3895 verbose unlock done using /root/.npm/_locks/staging-3a08f0df5026584d.lock for /usr/local/lib/node_modules/.staging
3896 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/hexo-cli/node_modules/fsevents):
3897 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
3898 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
3898 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
3898 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
3898 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
3899 verbose stack Error: hexo-util@0.6.1 postinstall: `npm run build:highlight`
3899 verbose stack Exit status 243
3899 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:289:16)
3899 verbose stack at emitTwo (events.js:125:13)
3899 verbose stack at EventEmitter.emit (events.js:213:7)
3899 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
3899 verbose stack at emitTwo (events.js:125:13)
3899 verbose stack at ChildProcess.emit (events.js:213:7)
3899 verbose stack at maybeClose (internal/child_process.js:921:16)
3899 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
3900 verbose pkgid hexo-util@0.6.1
3901 verbose cwd /
3902 verbose Linux 4.9.36-moby
3903 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "hexo-cli"
3904 verbose node v8.2.1
3905 verbose npm v5.3.0
3906 error code ELIFECYCLE
3907 error errno 243
3908 error hexo-util@0.6.1 postinstall: `npm run build:highlight`
3908 error Exit status 243
3909 error Failed at the hexo-util@0.6.1 postinstall script.
3909 error This is probably not a problem with npm. There is likely additional logging output above.
3910 verbose exit [ 243, true ]
Activity
NoahDragon commentedon Aug 9, 2017
Have you tried the solution listed here?
Lua12138 commentedon Aug 10, 2017
Thanks. It works now.
Solution
fredmj commentedon Aug 12, 2017
Thanks it's worked for me on virtualbox5/CentOS7.
Is a patch on the road?
Hexo look pretty great and I really wana try it in Production.
So I'like to be sure that all security and permissions considerations are ok.
Config:
Host:CentOS Linux release 7.3.1611 (Core)+ virtualbox 5.1.26r117224
Guest:
Installation
install NodeJS and upadte npm with:
Troubles
FIRST HEXO INSTALLATION FAILED*
*from a fresh install
[root@localhost opt]# npm install hexo-cli -g
**> hexo-util@0.6.1 build:highlight /usr/lib/node_modules/hexo-cli/node_modules/hexo-util
Soluce
HEXO INSTALLATION PASS
[root@localhost opt]# npm config set user 0
[root@localhost opt]# npm config set unsafe-perm true
[root@localhost opt]# npm install -g hexo-cli
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/hexo-cli/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"})
added 217 packages in 11.705s
yyman001 commentedon Mar 17, 2018
loading
[ .......] | extract:fsevents: sill pacote fsevents@http://r.cnpmjs.org/fsevents/download/fsevents-1.1.3.tgz
will stop...i try it for more...