Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation as super-user fails, after workaround logging directory is missing #361

Open
bitsgalore opened this issue Dec 4, 2021 · 0 comments

Comments

@bitsgalore
Copy link

bitsgalore commented Dec 4, 2021

As per the documentation, I installed Ace using (using sudo because earlier attempt at installing with default permissions failed):

sudo npm install @daisy/ace -g -unsafe-perm=true --allow-root

This resulted in:

sudo: npm: command not found

Which is strange, because npm works without sudo. A quick Google search on the error message led me here. I didn't want to mess with file permissions (which is one of the most popular suggestions in that thread), so instead I followed this suggestion. First I queried the location of npm using:

which npm

Result:

/home/johan/.nvm/versions/node/v10.11.0/bin/npm

I then created a symbolic link to this in /usr/bin:

sudo ln -s /home/johan/.nvm/versions/node/v10.11.0/bin/npm /usr/bin/npm

After this change I was able to run the install command without errors. However, after installation, running Ace on an EPUB now failed with the following error message:

(node:6038) ExperimentalWarning: The fs.promises API is experimental
Error: ENOENT: no such file or directory, mkdir '/home/johan/.local/state/DAISY Ace'
    at Object.mkdirSync (fs.js:731:3)
    at File._createLogDirIfNotExist (/usr/lib/node_modules/@daisy/ace/node_modules/winston/lib/winston/transports/file.js:691:10)
    at new File (/usr/lib/node_modules/@daisy/ace/node_modules/winston/lib/winston/transports/file.js:92:28)
    at Object.initLogger (/usr/lib/node_modules/@daisy/ace/node_modules/@daisy/ace-logger/lib/index.js:111:25)
    at Object.run (/usr/lib/node_modules/@daisy/ace/node_modules/@daisy/ace-cli-shared/lib/index.js:98:10)
    at Object.run (/usr/lib/node_modules/@daisy/ace/node_modules/@daisy/ace-cli/lib/index.js:7:13)
    at /usr/lib/node_modules/@daisy/ace/node_modules/@daisy/ace-cli/bin/ace.js:4:29
    at Object.<anonymous> (/usr/lib/node_modules/@daisy/ace/node_modules/@daisy/ace-cli/bin/ace.js:5:3)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)

A quick look my '/home/johan/.local/' directory showed that it didn't contain the 'state/DAISY Ace' subdirectories. After creating these directories manually Ace now works as expected.

I have no idea if the missing logging directory is a secondary effect of the symbolic link workaround I used to fix the npm issue, or some (unrelated) bug in Ace. In any case, since the problem with running npm with sudo permissions seems to be widespread, perhaps it would be helpful to add this information to the Troubleshooting page?

  • Ace v. 1.2.5
  • Node v10.11.0
  • Operating system: Linux Mint 20.1 Ulyssa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant