Permission errors in node_modules

#1

Also getting this error, not sure if related but wanted to group them.

On trying npm i, I get some permission errors in node_modules

npm ERR! path /app/node_modules/express/npm-shrinkwrap.json
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open '/app/node_modules/express/npm-shrinkwrap.json'
npm ERR!  { Error: EACCES: permission denied, open '/app/node_modules/express/npm-shrinkwrap.json'
npm ERR!   cause: 
npm ERR!    { Error: EACCES: permission denied, open '/app/node_modules/express/npm-shrinkwrap.json'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'open',
npm ERR!      path: '/app/node_modules/express/npm-shrinkwrap.json' },
npm ERR!   isOperational: true,
npm ERR!   stack: 'Error: EACCES: permission denied, open \'/app/node_modules/express/npm-shrinkwrap.json\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: '/app/node_modules/express/npm-shrinkwrap.json',
npm ERR!   parent: 'my-glitch-app' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

It resolved with npm i after blowing away node_modules, but then recurred several days later. It’s done that 2-3 times now even after fixing manually.

Error: Cannot find module 'express'
#2

Hi @trisweb, welcome to the Glitch forum!

If you run enable-pnpm in the console of your Glitch project does that help to resolve this error? You shouldn’t ever need to run npm i manually for your projects in Glitch, and this error seems to indicate that your project’s node_modules directory is having it’s permissions set incorrectly. I expect if you let Glitch manage your modules you may run into this error less often.

1 Like
#3

Hi cori,

Thanks so much! I tried that, and still got errors, slightly different than the above but the same as ones I saw prior as well.

Thanks!

internal/modules/cjs/loader.js:550

    throw err;

    ^


Error: Cannot find module 'express'

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)

    at Function.Module._load (internal/modules/cjs/loader.js:475:25)

    at Module.require (internal/modules/cjs/loader.js:598:17)

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

at Object.<anonymous> (/app/server.js:5:17)

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

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

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

    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)

    at Function.Module._load (internal/modules/cjs/loader.js:498:3)


node v9.11.2, with pnpm

Installing...

 WARN  Moving @slack/client that was installed by a different package manager to "node_modules/.ignored

ERROR  EACCES: permission denied, rename '/rbd/pnpm-volume/9193e809-f8e4-488c-b54f-5803e534475e/node_modules/@slack/client' -> '/rbd/pnpm-volume/9193e809-f8e4-488c-b54f-5803e534475e/node_modules/.ignored/@slack/client'

at ignored/


internal/modules/cjs/loader.js:550

    throw err;

    ^


Error: Cannot find module 'express'

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:548:15)

    at Function.Module._load (internal/modules/cjs/loader.js:475:25)

    at Module.require (internal/modules/cjs/loader.js:598:17)

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

at Object.<anonymous> (/app/server.js:5:17)

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

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

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

    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)

    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
#4

Hey @trisweb looks like you’re still having some sort of installation issue; can you provide your project name so we can take a look?

#5

Sure – is there a way I can share privately? It’s a private project.

#6

If your project is private, no one aside from folks you explicitly invite and a few Glitch staff will see your code (in part so we can help with problems like this), so you can safely provide your project name here. However, you’re also welcome to send a message to the @support_staff group or to me, or to send an email to support@glitch.com with your project details.

We don’t need the project’s “join” invite token to see your project; the project name is sufficient. You should avoid posting project invite tokens publicly for any project, private or not, because that gives anyone who follows them full access to your project and all of its data.

#7

Hi @cori, I’ve sent that to support@, was not able to sent a message to you or the group—I don’t want to share the project name publicly at this time as it shows internal content.

Still experiencing this issue frequently; only lasts 5-6 hours now before going down. I’m going to move it off Glitch but would love to fix the issue and keep it here. Let me know what we can do.

#9

Hey @trisweb it looks to me like you’ve fallen back on running npm i again based on the fact that you node_modules directory is local and not a symlink to a shared folder. Is that correct?

I think it’s going to be difficult for us to suss out what’s happening here if the project’s not running regularly, not to mention if node_modules is being manually removed and reinstalled, which basically breaks the automated installation process Glitch expects. The fact that the problem’s occurring every 5-6 hours is fairly odd; that doesn’t relate in any way that I can tell to anything that Glitch would be doing to your project (like the every-12-hour restart window, for instance).

I’m happy to dig into this more deeply and I’d be interested to know why this project seems to have trouble with the automatic installation if you care to pursue it.