Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

primordials is not defined #66

Open
ebdavison opened this issue Apr 30, 2021 · 3 comments
Open

primordials is not defined #66

ebdavison opened this issue Apr 30, 2021 · 3 comments

Comments

@ebdavison
Copy link

Expected Behavior

npm install && npm start to work properly to build and run the app

Actual Behavior

After npm install, there were no errors but when I did an npm start, I got the following error regarding primordials:

$ npm start

> [email protected] start /opt/Data/Software/paperless-desktop
> gulp && electron .

fs.js:45
} = primordials;
    ^

ReferenceError: primordials is not defined
    at fs.js:45:5
    at req_ (/opt/Data/Software/paperless-desktop/node_modules/natives/index.js:143:24)
                "test": "echo \"Error: no test specified\" && exit 1",
    at Object.req [as require] (/opt/Data/Software/paperless-desktop/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/opt/Data/Software/paperless-desktop/node_modules/vinyl-fs/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `gulp && electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

                "test": "echo \"Error: no test specified\" && exit 1",
{
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/edavison/.npm/_logs/2021-04-30T15_06_20_770Z-debug.log

Steps to Reproduce the Problem

  1. git clone the current repo
  2. npm install
  3. npm start

Specifications

  • Version of Paperless: paperless-ng 1.4.0
  • Version of Paperless-Desktop: current version in git as of 2021-04-30
  • Platform: linux fedora 34
  • Version of NodeJS (if applicable): v14.16.1
@ebdavison
Copy link
Author

I was able to make the app start by applying the "if you are using npm" section from this stack overflow post:
https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node

Specifically:

If you are using npm

Using npm-force-resolutions as a preinstall script, you can obtain a similar result as with yarn v1. You need to modify your package.json this way:

{
  // Your current package.json
  "scripts": {
    // Your current package.json scripts
    "preinstall": "npx npm-force-resolutions"
  },
  "resolutions": {
    "graceful-fs": "^4.2.4"
  }
}

npm-force-resolutions will alter the package-lock.json file to set graceful-fsto the wanted version before the install is done.

If you are using a custom .npmrc file in your project and it contains either a proxy or custom registry, you might need to change npx npm-force-resolutions to npx --userconfig .npmrc npm-force-resolutions because as of now, npx doesn't use the current folder .npmrc file by default.

@ebdavison
Copy link
Author

Now that the app runs though, I get an error:
image

However, all of my Correspondents do show up on the left side of the screen:
image

@ebdavison
Copy link
Author

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant