Running into a file system error when following this guide
running git push balena master rather than resin master.
Blockquote
[file-manager] npm ERR!
[file-manager] errno -2
[file-manager]
[file-manager] npm
[file-manager] ERR!
[file-manager] enoent
[file-manager] ENOENT: no such file or directory, chmod ‘/usr/local/lib/node_modules/node-file-manager/node-file-manager/bin/node-file-manager.sh’
[file-manager] npm ERR!
[file-manager] enoent
[file-manager] This is related to npm not being able to find a file.
[file-manager] npm ERR! enoent
[file-manager]
[file-manager]
[file-manager]
[file-manager] npm
[file-manager] ERR! A complete log of this run can be found in:
[file-manager]
[file-manager] npm
[file-manager] ERR! /root/.npm/_logs/2020-06-27T03_49_47_539Z-debug.log
[file-manager]
[file-manager] The command ‘/bin/sh -c npm install --unsafe-perm -g node-file-manager’ returned a non-zero code: 254
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: file-manager
[Error] Error: The command ‘/bin/sh -c npm install --unsafe-perm -g node-file-manager’ returned a non-zero code: 254
[Info] Built on arm01
[Error] Not deploying release.
remote: error: hook declined to update refs/heads/master
To git.balena-cloud.com:g_shayne_smith/boombeastic.git
! [remote rejected] master → master (hook declined)
error: failed to push some refs to ‘git.balena-cloud.com:g_shayne_smith/boombeastic.git’
Hey, boombeastic uses this npm package for the file manager functionality:
And it looks like it has a weird reference to the sh file mentioned in the error message (that reference tries to escape the project root):
I think it should be simply bin/node-file-manager.sh instead.
Maybe this was working with older npm versions before, but definitely does not work now.
The correct way would be to fix it in the node-file-manager module, but I cannot submit a pull request because github is having issues
Another way to fix this might be trying a base image with an older NPM version.
Hey there,
I would recommend waiting for the upstream PR to be merged and using that.
But to answer your question, here is the workaround:
Change the line RUN npm install --unsafe-perm -g node-file-managerhere to RUN npm install -g https://github.com/iamsolankiamit/node-file-manager/tarball/patch-1
The boombastic project should now build successfully.