Issues with installing edge-impulse-cli on MacOS Big Sur (11.2)

I can not get edge-impulse-cli installed on macOS Big Sur (11.2)
here is my terminal output, the installation just hangs on the last line:

% sudo npm install -g edge-impulse-cli
npm WARN deprecated @zeit/dockerignore@0.0.5: “@zeit/dockerignore” is no longer maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
⸨ ⸩ ⠙ reify:rxjs: timing reifyNode:node_modules/edge-impulse-cli Completed in 2405ms

@gpolder, on macOS I’d recommend not using sudo. Can you give it another try without that?

I need sudo, as I don’t have write access to /usr/local/lib/node_modules/

  $ npm install -g edge-impulse-cli

    npm notice

    npm notice New minor version of npm available! 7.5.3 -> 7.6.0

    npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.6.0

    npm notice Run npm install -g npm@7.6.0 to update!

    npm notice

    npm ERR! code EACCES

    npm ERR! syscall mkdir

    npm ERR! path /usr/local/lib/node_modules/edge-impulse-cli

    npm ERR! errno -13

    npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/edge-impulse-cli'

    npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/edge-impulse-cli'] {

    npm ERR! errno: -13,

    npm ERR! code: 'EACCES',

    npm ERR! syscall: 'mkdir',

    npm ERR! path: '/usr/local/lib/node_modules/edge-impulse-cli'

    npm ERR! }

    npm ERR!

Hi @gpolder,

You can change the owner of the node_modules directory as mentioned in the documentation:

sudo chown -R $USER /usr/local/lib/node_modules

Let us know if that helps,

Aurelien

thanks for the quick response.
deprecated warnings still remain, but otherwise the installation was successful.
Thanks for helping out.

1 Like

I was also below process but still .I’m unable to install CLI

  • uninstalling
  • sudo chown -R $USER /usr/local/lib/node_modules

sudo npm install -g edge-impulse-cli

npm WARN deprecated @zeit/dockerignore@0.0.5: “@zeit/dockerignore” is no longer maintained

npm WARN deprecated request-promise@4.2.4: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142

npm WARN deprecated request@2.88.0: request has been deprecated, see

npm WARN deprecated har-validator@5.1.5: this library is no longer supported

npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

/usr/local/bin/edge-impulse-blocks -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/blocks.js

/usr/local/bin/edge-impulse-uploader -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/uploader.js

/usr/local/bin/edge-impulse-daemon -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/daemon.js

/usr/local/bin/edge-impulse-data-forwarder -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/data-forwarder.js

/usr/local/bin/edge-impulse-run-impulse -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/run-impulse.js

/usr/local/bin/eta-flash-tool -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/eta-flash-tool/flashtool.js

/usr/local/bin/edge-impulse-framebuffer2jpg -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/framebuffer-to-jpg.js

/usr/local/bin/himax-flash-tool -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/himax-flash-tool/flashtool.js

@serialport/bindings@8.0.8 install /usr/local/lib/node_modules/edge-impulse-cli/node_modules/@serialport/bindings

prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install EACCES: permission denied, access ‘/Users/ayushkhandelwal/.npm’

gyp WARN EACCES current user (“nobody”) does not have permission to access the dev dir “/Users/ayushkhandelwal/Library/Caches/node-gyp/14.18.0”

gyp WARN EACCES attempting to reinstall using temporary dev dir “/usr/local/lib/node_modules/edge-impulse-cli/node_modules/@serialport/bindings/.node-gyp”

gyp WARN install got an error, rolling back install

gyp WARN install got an error, rolling back install

gyp ERR! configure error

gyp ERR! stack Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/edge-impulse-cli/node_modules/@serialport/bindings/.node-gyp’

gyp ERR! System Darwin 20.3.0

gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”

gyp ERR! cwd /usr/local/lib/node_modules/edge-impulse-cli/node_modules/@serialport/bindings

gyp ERR! node -v v14.18.0

gyp ERR! node-gyp -v v5.1.0

gyp ERR! not ok

npm WARN tsargs@1.4.1 requires a peer of typescript@^3.1.6 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! @serialport/bindings@8.0.8 install: prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the @serialport/bindings@8.0.8 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/ayushkhandelwal/.npm/_logs/2021-10-05T10_04_27_986Z-debug.log

@Ayushkh you should never use sudo on macOS, it screws up stuff…

You probably want to fix permissions via:

$ sudo chown -R $USER /usr/local/lib/node_modules
$ sudo chown -R $USER ~/.npm
$ sudo chown -R $USER /Users/ayushkhandelwal/Library/Caches/node-gyp

Then:

$ npm install edge-impulse-cli -g

(no sudo on the last one)

Still not working…

ayushkhandelwal@Ayushs-MacBook-Pro ~ % npm uninstall -g edge-impulse-cli

up to date in 0.035s

ayushkhandelwal@Ayushs-MacBook-Pro ~ % sudo chown -R $USER /usr/local/lib/node_modules

ayushkhandelwal@Ayushs-MacBook-Pro ~ % sudo chown -R $USER ~/.npm

ayushkhandelwal@Ayushs-MacBook-Pro ~ % sudo chown -R $USER /Users/ayushkhandelwal/Library/Caches/node-gyp

ayushkhandelwal@Ayushs-MacBook-Pro ~ % npm install edge-impulse-cli -g

npm WARN deprecated request@2.88.0: request has been deprecated, see
npm WARN deprecated request-promise@4.2.4: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142

npm WARN deprecated @zeit/dockerignore@0.0.5: “@zeit/dockerignore” is no longer maintained

npm WARN deprecated har-validator@5.1.5: this library is no longer supported

npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

/usr/local/bin/eta-flash-tool -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/eta-flash-tool/flashtool.js

/usr/local/bin/edge-impulse-daemon -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/daemon.js

/usr/local/bin/edge-impulse-run-impulse -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/run-impulse.js

/usr/local/bin/himax-flash-tool -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/himax-flash-tool/flashtool.js

/usr/local/bin/edge-impulse-framebuffer2jpg -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/framebuffer-to-jpg.js

/usr/local/bin/edge-impulse-blocks -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/blocks.js

/usr/local/bin/edge-impulse-data-forwarder -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/data-forwarder.js

/usr/local/bin/edge-impulse-uploader -> /usr/local/lib/node_modules/edge-impulse-cli/build/cli/uploader.js

@serialport/bindings@8.0.8 install /usr/local/lib/node_modules/edge-impulse-cli/node_modules/@serialport/bindings

prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=14.18.0 runtime=node arch=x64 libc= platform=darwin)

No receipt for ‘com.apple.pkg.CLTools_Executables’ found at ‘/’.

No receipt for ‘com.apple.pkg.DeveloperToolsCLILeo’ found at ‘/’.

No receipt for ‘com.apple.pkg.DeveloperToolsCLI’ found at ‘/’.

gyp: No Xcode or CLT version detected!

gyp ERR! configure error

gyp ERR! stack Error: gyp failed with exit code: 1

gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)

gyp ERR! stack at ChildProcess.emit (events.js:400:28)

gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)

gyp ERR! System Darwin 20.3.0

gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild”

gyp ERR! cwd /usr/local/lib/node_modules/edge-impulse-cli/node_modules/@serialport/bindings

gyp ERR! node -v v14.18.0

gyp ERR! node-gyp -v v5.1.0

gyp ERR! not ok

npm WARN tsargs@1.4.1 requires a peer of typescript@^3.1.6 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! @serialport/bindings@8.0.8 install: prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the @serialport/bindings@8.0.8 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/ayushkhandelwal/.npm/_logs/2021-10-05T10_28_34_649Z-debug.log

It just work after I installed node with NVM

After I looked into this issue

forum :- error-could-not-locate-the-bindings-file/2286/5

Then I run the commons I suggested

$ sudo chown -R $USER /usr/local/lib/node_modules
$ sudo chown -R $USER ~/.npm
$ sudo chown -R $USER /Users/ayushkhandelwal/Library/Caches/node-gyp

Then I used --force to installed
npm install -g edge-impulse-cli --force

npm WARN using --force Recommended protections disabled.

npm WARN deprecated @zeit/dockerignore@0.0.5: “@zeit/dockerignore” is no longer maintained

npm WARN deprecated har-validator@5.1.5: this library is no longer supported

npm WARN deprecated request-promise@4.2.4: request-promise has been deprecated because it extends the now deprecated request package, see

npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See .

npm WARN deprecated request@2.88.0: request has been deprecated
added 299 packages, and audited 300 packages in 1m

12 packages are looking for funding

run npm fund for details

3 vulnerabilities (1 low, 1 moderate, 1 high)

To address all issues (including breaking changes), run:

npm audit fix --force

Run npm audit for details.

npm notice

npm notice New patch version of npm available! 7.24.0 -> 7.24.2

npm notice Changelog:

npm notice Run npm install -g npm@7.24.2 to update!

npm notice

Still show the waring but get installed.

Thank you for quick Response

Cheers :slight_smile:

1 Like