Npm errors when attempting to add modules

When attempting to install modules and running npm install i get the following errors:

$ npm install
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/nodemon-96ce64d0/lib/monitor/run.js'
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/nodemon-96ce64d0/lib/monitor/signals.js'
npm WARN tar ENOENT: no such file or directory, open '/app/node_modules/.staging/nodemon-96ce64d0/lib/monitor/watch.js'
npm ERR! path /app/node_modules/.staging/ejs-e001a11a/node_modules/ansi-styles
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/app/node_modules/.staging/ejs-e001a11a/node_modules/ansi-styles' -> '/app/node_modules/.staging/ansi-styles-1bb60e8a'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/npm-cache/10.15.3/_logs/2020-07-28T11_07_27_421Z-debug.log

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

7:08 AM

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

7:08 AM

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

7:08 AM

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

7:08 AM

Jump Toat Object. (/app/server.js:2:17)

7:08 AM

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

7:08 AM

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

7:08 AM

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

7:08 AM

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

7:08 AM

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

@glitch_support UPDATE: It seems to be happening no matter what module i add. Could someone please look into this?

Hi, you could try installing the packages using the pnpm binary instead of the npm binary. For reference:

@ihack2712 Nope:

app@mealspos-app:~ 12:15 
$ npm init
-su: npm: command not found

app@mealspos-app:~ 12:15 
$ pnpm install --save express
/usr/bin/env: ‘node’: No such file or directory

Can you invite me to the project so I can attempt to debug the errors? (Send invite link in DMs)

Done, sent invite link via dm.

Can you run
cat /tmp/npm-cache/10.15.3/_logs/2020-07-28T11_07_27_421Z-debug.log so we can see the full error?

The issue was here that the package.json file was called package.dson. Therefore it was a static site and node didn’t exist. I have now run these commands after creating a package.json file:

pnpm i -S express ejs
pnpm i -D nodemon

to install the packages you wanted.

When installing new packages please use the pnpm command :slight_smile:

1 Like

Your project seems to be working now, so I left the project!

Feel free to open up a new thread or continue posting in this one if you have any more issues :wave:

2 Likes

Thanks for the help, wish the help guides told me beforehand to use pnpm instead of the norm npm. :+1:

Anytime!

The reason why Glitch uses pnpm is because of the caching features of it I believe. I’m a bit unsure :wink: