yoshuawuyts / vmd

:pray: preview markdown files
MIT License
1.18k stars 111 forks source link

Error when trying to install #131

Closed jamesla closed 5 years ago

jamesla commented 5 years ago

Anybody seen this one before?

root@ubuntu:/usr/lib/node_modules# sudo npm install -g vmd
npm WARN deprecated mixin-deep@1.3.1: Critical bug fixed in v2.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@2.0.0: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated set-value@0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
/usr/bin/vmd -> /usr/lib/node_modules/vmd/bin/cli.js

> electron@3.1.11 postinstall /usr/lib/node_modules/vmd/node_modules/electron
> node install.js

/usr/lib/node_modules/vmd/node_modules/electron/install.js:49
  throw err
  ^

Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/vmd/node_modules/electron/.electron'
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@3.1.11 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@3.1.11 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:

Log

11179 info lifecycle progress-stream@1.2.0~postinstall: progress-stream@1.2.0
11180 silly postinstall nugget@2.0.1
11181 info lifecycle nugget@2.0.1~postinstall: nugget@2.0.1
11182 silly postinstall electron-download@4.1.1
11183 info lifecycle electron-download@4.1.1~postinstall: electron-download@4.1.1
11184 silly postinstall yaml-js@0.2.3
11185 info lifecycle yaml-js@0.2.3~postinstall: yaml-js@0.2.3
11186 silly postinstall yauzl@2.4.1
11187 info lifecycle yauzl@2.4.1~postinstall: yauzl@2.4.1
11188 silly postinstall extract-zip@1.6.7
11189 info lifecycle extract-zip@1.6.7~postinstall: extract-zip@1.6.7
11190 silly postinstall chokidar@2.1.6
11191 info lifecycle chokidar@2.1.6~postinstall: chokidar@2.1.6
11192 silly postinstall deep-equal@1.0.1
11193 info lifecycle deep-equal@1.0.1~postinstall: deep-equal@1.0.1
11194 silly postinstall electron@3.1.11
11195 info lifecycle electron@3.1.11~postinstall: electron@3.1.11
11196 verbose lifecycle electron@3.1.11~postinstall: unsafe-perm in lifecycle false
11197 verbose lifecycle electron@3.1.11~postinstall: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/lib/node_modules/vmd/node_modules/electron/node_modules/.bin:/usr/lib/node_modules/vmd/node_modules/.bin:/usr
/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
11198 verbose lifecycle electron@3.1.11~postinstall: CWD: /usr/lib/node_modules/vmd/node_modules/electron
11199 silly lifecycle electron@3.1.11~postinstall: Args: [ '-c', 'node install.js' ]
11200 silly lifecycle electron@3.1.11~postinstall: Returned: code: 1  signal: null
11201 info lifecycle electron@3.1.11~postinstall: Failed to exec postinstall script
11202 timing action:postinstall Completed in 210ms
11203 verbose unlock done using /root/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging
11204 timing stage:rollbackFailedOptional Completed in 244ms
11205 timing stage:runTopLevelLifecycles Completed in 7946ms
11206 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/vmd/node_modules/fsevents):
11207 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11208 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
11208 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
11208 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
11208 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
11209 verbose stack Error: electron@3.1.11 postinstall: `node install.js`
11209 verbose stack Exit status 1
11209 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
11209 verbose stack     at EventEmitter.emit (events.js:198:13)
11209 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
11209 verbose stack     at ChildProcess.emit (events.js:198:13)
11209 verbose stack     at maybeClose (internal/child_process.js:982:16)
11209 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
11210 verbose pkgid electron@3.1.11
11211 verbose cwd /usr/lib/node_modules
11212 verbose Linux 4.15.0-46-generic
11213 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "vmd"
11214 verbose node v10.16.0
11215 verbose npm  v6.9.0
11216 error code ELIFECYCLE
11217 error errno 1
11218 error electron@3.1.11 postinstall: `node install.js`
11218 error Exit status 1
11219 error Failed at the electron@3.1.11 postinstall script.
maxkueng commented 5 years ago

This is probably because you're installing the package as root, which is not recommended. You should install packages in to your home directory and then adding the directory where the binaries are located to your PATH variable.

There are instructions for this here: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

It's probably good to remove the vmd package that you had installed as root before you install it as a non-root user: sudo rm -rf /usr/lib/node_modules/vmd

After you've completed the steps, just install vmd without sudo: npm install -g vmd And then start it by typing vmd.

I'm closing this ticket. If the instructions above do not resolve your issue, feel free to reopen.