CannerCMS / cannercms

⚡️ Content Management Framework creates custom CMS fast and easy. Support data sources such as Firebase/Firestore, GraphQL and Restful APIs.

Home Page:https://www.cannerdata.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: EACCESS: permission denied - installing on linux with sudo npm install -g @canner/cli

odifek opened this issue · comments

Throws this error,
sudo npm install -g @canner/cli Sun 25 Nov 2018 00:35:13 WAT

/usr/bin/canner -> /usr/lib/node_modules/@canner/cli/download/dist/cli

> @canner/cli@2.6.10 postinstall /usr/lib/node_modules/@canner/cli
> node download/install.js

(node:16517) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, open '/home/kennedy/.config/configstore/undefined.json'
You don't have access to this file.

at Object.openSync (fs.js:436:3)
at Object.readFileSync (fs.js:341:35)
at t.exports.get all [as all] (/usr/lib/node_modules/@canner/cli/download/dist/download.js:30:12893)
at new t.exports (/usr/lib/node_modules/@canner/cli/download/dist/download.js:30:12854)
at N (/usr/lib/node_modules/@canner/cli/download/dist/download.js:1:39815)
at /usr/lib/node_modules/@canner/cli/download/dist/download.js:1:40262
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

(node:16517) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:16517) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

  • @canner/cli@2.6.10
    added 20 packages from 11 contributors in 5.156s

However, if I do cd /usr/lib/node_modules/@canner/cli && sudo node download/install.js it will successfully install, and I am able to run and serve canner. But I discovered that some things don't work, like @canner/storage, reports dependency not available

commented

Thanks for the report and glad to know you've installed CLI.
I think sudo npm is not a good usage. So we won't change the installation process for now. See resolving-eacces-permissions-errors-when-installing-packages-globally.

commented

Hi, @singerswang, thanks for the report. As I mentioned above, the issue happens if you still install @canner/cli with sudo.

The current solution is following the offical docs to change the npm directory, so you can install the CLI without sudo.

If you tried it and had further problems, please let us know. Thanks again!