Sam Update Error

Hi,
received a notification on the terminal window to update sam 0.0.53-> 0.0.55. But received an error as follows:
Error: Enoent: no such file or directory, uv_cwd.

╭───────────────────────────────────────╮
│ │
│ Update available 0.0.53 → 0.0.55 │
│ Run npm i -g snips-sam to update │
│ │
╰───────────────────────────────────────╯

pi@raspberrypi:/usr/share/snips/assistant $ sudo npm i -g snips-sam
path.js:1165
path = process.cwd();
^

Error: ENOENT: no such file or directory, uv_cwd
at Object.resolve (path.js:1165:24)
at Function.Module._resolveLookupPaths (module.js:424:17)
at Function.Module._resolveFilename (module.js:542:20)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at /usr/lib/node_modules/npm/bin/npm-cli.js:19:21
at Object. (/usr/lib/node_modules/npm/bin/npm-cli.js:153:3)
at Module._compile (module.js:653:30)
at Object.Module._extensions…js (module.js:664:10)

Any advise? Thanks

Hi @Superbigfatdaddy,

This error is not directly related to sam, it likely comes from npm. You might want to check your existing npm setup and your filesystem permissions.

I would advise looking it up on your favourite search engine.

pi@raspberrypi:/usr/share/snips/assistant $ sudo npm i -g snips-sam

(Also, sam is supposed to be installed on your laptop/desktop computer not on the raspberry itself.)

Hi Elbywan,

Thanks for the tip. It is indeed the permission issue. Just putting the sudo in front solved the problem.

Same here:

kk@kkdevs:~$ sam watch
[16:35:10] Watching on localhost:1883 (MQTT)
^C


   ╭───────────────────────────────────────╮
   │                                       │
   │   Update available 0.0.53 → 0.0.55    │
   │     Run npm i snips-sam to update     │
   │                                       │
   ╰───────────────────────────────────────╯

kk@kkdevs:~$ sudo npm i snips-sam
[sudo] Passwort für kk: 
/home/kk
└─┬ snips-sam@0.0.55 
  └─┬ shelljs@0.8.3
    └─┬ rechoir@0.6.2
      └── resolve@1.11.0 

npm WARN enoent ENOENT: no such file or directory, open '/home/kk/package.json'
npm WARN kk No description
npm WARN kk No repository field.
npm WARN kk No README data
npm WARN kk No license field.

As you can see, sudo doesn’t fix it. What’s wrong? Should there be a package.json in my home directory?

Try with the -g flag: npm i -g snips-sam.

Works, thanks @elbywan !

1 Like