Topic on Talk:Citoid

npm WARN tar ENOENT: no such file or directory

4
Guillaume Taillefer (talkcontribs)

I tried installing both the translation-server and the zotero service from mediawiki via their git commands, and upon going in their respective directories, and trying to use npm install, they give me 100+ different versions of the same error:

npm WARN tar ENOENT: no such file or directory ...

For example one of the ones from translation-service:

npm WARN tar ENOENT: no such file or directory, lstat '/home2/wwiiarch/translation-server/node_modules/.staging/core-js-f5f4dd1d/modules'

The common thing that I have found for both of these is that when I go into each node_modules directory, it shows that they're emtpy. This is despite the fact that none of the isntructions tell me anything about this, and just say to use the git command. However it seems that I use the npm commands its looking for a .staging folder inside node_modules.

My version of node is v10.24.1 (before I was trying v12.22.12 but it doesn't seem to change anything), and my version of npm is 6.14.16

How do I fix this problem? Thanks

Mvolz (WMF) (talkcontribs)

Did you use the --recurse-submodules flag when you did git clone?

If not you may be missing the submodules in your repo. If you do

git submodule init
git submodule update 
npm install

In your translation-server directory, hopefully that fixes it.

Guillaume Taillefer (talkcontribs)

Did you use the --recurse-submodules flag when you did git clone?

Yes that's in the instructions to do for both translation-server and zotero.

I tried both tried using the above commands in both translation-server/ and translation-server/node_modules.

For translation-server/node_modules both the first two git commands resulted in no errors, I just typed them in, enter, and nothing. Then I do npm install, and it throws the hundreds of basically the same error again. In the middle of it it gave this error:

npm ERR! Error while executing:

npm ERR! /usr/local/cpanel/3rdparty/lib/path-bin/git ls-remote -h -t ssh://git@github.com/zotero/wicked-good-xpath.git

npm ERR!

npm ERR! Permission denied (publickey).

npm ERR! fatal: Could not read from remote repository.

npm ERR!

npm ERR! Please make sure you have the correct access rights

npm ERR! and the repository exists.

npm ERR!

npm ERR! exited with error code: 128

And then it continued on and then eventually stopped with the error that the log could be found in debug logs. I then went to do it in just translation-server/. This did the exact same thing with the git commands, and when I did npm install, it did the same thing with the errors except it continually repeated the same looking error from my original comment, and then ended with this:

npm ERR! Error while executing:

npm ERR! /usr/local/cpanel/3rdparty/lib/path-bin/git ls-remote -h -t ssh://git@github.com/zotero/wicked-good-xpath.git

npm ERR!

npm ERR! Warning: Permanently added the ECDSA host key for IP address '140.82.113.4' to the list of known hosts.

npm ERR! Permission denied (publickey).

npm ERR! fatal: Could not read from remote repository.

npm ERR!

npm ERR! Please make sure you have the correct access rights

npm ERR! and the repository exists.

npm ERR!

npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:

npm ERR!     /home2/wwiiarch/.npm/_logs/2022-11-01T22_04_08_734Z-debug.log

It seems to me that since I am on shared hosting this might have a thing to do with it. Thanks

Guillaume Taillefer (talkcontribs)

Ok so I have made some progress. First I deleted npm and node (as well as zotero), then redownloaded them with nvm (node v12.22.22). Then I retried downloading zotero, along with cd zotero, npm install. I got the deprecated errors again. One of those deprecated messages mentioned something about an outdated core-js. I then did npm install --save core-js. As far as I remember success for that. I then found out about npm outdated, which I then typed in (in zotero), and then I got the results of aws-sdk missing, along with md5, require, @zotero/eslint-config, etc. I then did npm install aws-sdk, which was mostly successful except for a few errors, which was taken care of using npm audit fix --force. I then fixed md5, require, @zotero/eslint-config, and some other ones, and it was pretty much up to date. I then did npm install, and finally it was successful! I then tried npm start, and there was a problem I have no idea how to solve:

> translation-server@2.0.4 start

> node src/server.js

/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/browser/parser/html.js:170

    after._pushedOnStackOfOpenElements?.();

                                      ^

SyntaxError: Unexpected token '.'

    at wrapSafe (internal/modules/cjs/loader.js:915:16)

    at Module._compile (internal/modules/cjs/loader.js:963:27)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

    at Module.load (internal/modules/cjs/loader.js:863:32)

    at Function.Module._load (internal/modules/cjs/loader.js:708:14)

    at Module.require (internal/modules/cjs/loader.js:887:19)

    at require (internal/modules/cjs/helpers.js:74:18)

    at Object.<anonymous> (/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/browser/parser/index.js:4:20)

    at Module._compile (internal/modules/cjs/loader.js:999:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

This seems like this is all supposed to be there, so I didn't exactly want to modify the code; However I tried it once by deleting both the ? and . for both the shown variable and the one under, which showed no errors in the code. However when I run npm start again, it gave me a whole load of errors:

ReferenceError: FinalizationRegistry is not defined

    at new IterableWeakSet (/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/living/helpers/iterable-weak-set.js:9:38)

    at new DocumentImpl (/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/living/nodes/Document-impl.js:177:34)

    at Object.exports.setup (/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/living/generated/Document.js:106:12)

    at Object.exports.create (/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/living/generated/Document.js:47:18)

    at Object.exports.createImpl (/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/living/generated/Document.js:51:27)

    at Object.exports.createImpl (/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/living/documents.js:10:19)

    at Object.exports.createWrapper (/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/living/documents.js:14:33)

    at new Window (/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/browser/Window.js:236:30)

    at exports.createWindow (/home2/wwiiarch/zotero/node_modules/jsdom/lib/jsdom/browser/Window.js:96:10)

    at new JSDOM (/home2/wwiiarch/zotero/node_modules/jsdom/lib/api.js:36:20)


Anyone have the answer to this? Thanks

Reply to "npm WARN tar ENOENT: no such file or directory"